Selenium Framework for Beginners 13 | Selenium What is testng.xml | How to create testng.xml

preview_player
Показать описание
Today we will learn:
Add TestNG plugin
Add testng library (Java and Maven project)
Create and run TestNG tests
Create run configuration for TestNG
How to create TestNg reports

STEPS: TestNG on Intellij IDEA

Step 1 - Open IntelliJ IDEA

Step 2 - Goto Settings > Plugins (check if testng is available)

Step 3 - Add TestNG jar OR Maven dependency

Step 4 - Create class and test methods - Add testng annotations > Run

To Create configuration - Run > Edit Configurations

Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you

You can support my mission for education by sharing this knowledge and helping as many people as you can

If my work has helped you, consider helping any animal near you, in any way you can.

________ ONLINE COURSES TO LEARN ________

Never Stop Learning
Raghav
Practical Example

The configuration file in TestNG

Used to provide test execution settings
e.g.
include tests, class, packages etc
exclude tests, class, package etc
set test dependency
set test priorities
pass parameters to test methods
run in parallel

Used to control the execution of TestNG tests
#SeleniumJavaTutorials #SeleniumBeginnerTutorials #SeleniumTraining

PLAYLISTS

KATALON STUDIO

SELENIUM BEGINNERS

SELENIUM JAVA FRAMEWORK BEGINNERS

SELENIUM TIPS

SELENIUM PYTHON

SELENIUM BUILDER

JAVA

JAVA TIPS & TRICKS

JENKINS

JENKINS TIPS & TRICKS

JMETER BEGINNER

JMETER INTERMEDIATE

JMETER ADVANCED

JMETER TIPS & TRICKS

SOAPUI

POSTMAN

GIT & GITHUB

DOCKER

ROBOT FRAMEWORK

WEB SERVICES (API)

REDIS BEGINNER TUTORIALS

MAVEN

MISC

TOOLS & TIPS

QnA FRIDAY

SUNDAY SPECIAL

ALL PLAYLISTS

Like on FACEBOOK :

Follow on TWITTER:

Subscribe on YOUTUBE :

________ ONLINE COURSES TO LEARN ________

Like, Subscribe & Share
You can support my mission for education by sharing this knowledge and helping as many people as you can

Never Stop Learning
Raghav
Рекомендации по теме
Комментарии
Автор

thanks Raghav,
you're an excellent teacher.
Very helpful session.
you make things very simple for us.
Its very easy to follow your tutorials/videos.

deepakrai
Автор

As always, one more simple yet effective learning experience. Thank you for sharing.

flirtuall
Автор

Thanks for the playlist it's very useful . but we need video for something like real project with a lot of test cases.
I wish you are planning for that :)

ahmedagamy
Автор

Hi Raghav, This is Harmeet, your videos are really good.I want to ask you if making multiple TestNg.xml is common and how will you run through Jenkins.If you can create video on Multiple testng suites, it would be good.Thanks

ramanwalia
Автор

Dear Raghav, thank you for all your work and videos. May I kindly ask what you are using as your empty browser page which is showing you name, greeting, date, time etc? Thank you so much. KR Mario

buma
Автор

Hi Raghav,
Thanks for the video,

I am facing one issue.
I am running two classes(One @Test in each) in parallel using testBase class in my framework. testBase class is having initialSetup() method which launches the browser.
After running the xml file it launches two browser but only one browser is able to run the one class another browser is not able to run the second class.
Console showing no error:

Suite1
Total tests run: 2, Passes: 2, Failures: 0, Skips: 0


Please help in this issue

ganeshadsule
Автор

Hi Raghav,
Thanks a lot for reply my earlier question.
I am struck up, plz help.
my problem is, I have a test1, test2 and test3 are 3 methods in first testcase and while execution, got exception in test2 method then I want to stop execution of test3 and pickup second testcase.

AnilKumar-sfem
Автор

Thanks for the video Raghav you are a star. Just a quick question/request from my side I am not sure if this is an appropriate section to do this request. I have been stuck for quite some time now I am trying to highlight a text in a p tag. For example:- Say I have the following <p> I love watching Automation Step by Step video tutorial because Raghav gives sufficient information</p> and from the previous p tag I want to highlight a word for an example "Automation". Can you please do a video for this or point me to a direction where I can find help. Thanks in advance!!!

senzontuli
Автор

One doubt. I have two class files (two scripts). I have created a testng.xml by right-clicking and selecting 'convert to testng.xml' of the first class file. Then I ran the second class file by choosing the option 'Run as TestNG set'. It executed the second script successfully. My doubt is, the testng.xml contains settings of the first-class file. But when we execute the second script where the testng.xml file created? Is it created internally and destroyed it?

starSha
Автор

one more doubt. I have two class files (two scripts). driver.quit() line is present in both scripts. I ran it sequentially using testng.xml after mentioning both class names. My observation was that, two browser windows opened at the same time, then executed script one by one in each window, then closed both windows together. So, if 100 scripts are running together 100 browser window will keep it open at the same time eventhough it is sequential execution? can we avoid it?

starSha
Автор

Hi Raghav, Is it possible to execute my parallel test cases on different browsers?

rahulsikarwar
Автор

HI Raghav, thanks for your sharing. I did follow this video step by step, I have issue when run 2 classes parallel ( sequence running is ok). After run result is "Total tests run: 2, Failures: 1, Skips: 0". I don't understand why the second class run successfully, but the first one is fail.

thanhdungnguyenthi
Автор

Hi Sir please make a video on complete Java OOPS concept which is frequently asked in Interviews

wasimakram-nzgq
Автор

hello sir,
i m writing the same program as you sow in this video but text ex. "abcd" not written in text box field.what can i do to resolve it.

mohammadsalman
Автор

I had a problem:
When I run without the parallel test my result is positive, but when run with the parallel test I get the following error: The driver executable does not exist:

rebekamontana
Автор

Hi raghav,
Convert to testng option not opening ganarate testng.xml file window is not opening
Need help to solve this

pravinjadhav
Автор

org.testng.TestNGException: unable to find valid certification path to requested target
- I am getting this error when clicking Run As on testng.xml

rudrakshgandhar
Автор

xml is not visible in other-->wizard. can you please help me to resolve?

saiswaroopbedamatta
Автор

Hi Raghav Pal, i have created testng.xml and added the code and when I run as testngsuite im getting the following error

vamshikrishnapallerla
Автор

When a create testNg_Demo2 from testNg_Demo, and put the testNg_demo2 in testng.xml (<suite name="Suite1" parallel="classes">
<test thread-count="5" name="Test1" parallel="classes">
<classes>
<class name="test.TestNG_Demo"/>
<class name="test.TestNG_Demo2"/>
</classes>
</test>
</suite>

and run, I have the following error below.: error: The driver executable does not exist:

rebekamontana