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 :)
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
Hi Raman, yes we can do to run specific tests. Like smoke, sanity, regression suite etc. You can just copy the command to run testng.xml in jenkins. See more videos in this playlist
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
Hi Ganesh, you will need to call the browser setup code both times when running in parallel. I will need to check more, You can try some online help meanwhile
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
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?
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.
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: java.lang.IllegalStateException: The driver executable does not exist: C:\Users ebeka\Downloads\ESTADAO\AUTOM1\drivers\geckodriver\chromedriver.exe
Hi Rebeka, pls check this - stackoverflow.com/questions/51607304/java-lang-illegalstateexception-the-driver-executable-does-not-exist-while-try This one might not be directly related to your issue but will help in the concept - github.com/cbeust/testng/issues/1336
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?
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.
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 I love watching Automation Step by Step video tutorial because Raghav gives sufficient information 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!!!
org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target - I am getting this error when clicking Run As on testng.xml
Hi Rudraksh, this most possibly is issue with your testng.xml file. Pls check this -stackoverflow.com/questions/49339698/org-testng-testngexception-sun-security-provider-certpath-suncertpathbuilderexc
When a create testNg_Demo2 from testNg_Demo, and put the testNg_demo2 in testng.xml (
and run, I have the following error below.: error: java.lang.IllegalStateException: The driver executable does not exist: C:\Users ebeka\Downloads\ESTADAO\AUTOM1\drivers\geckodriver\chromedriver.exe
Hi Vinay, when you hover over the error or click on it, you will get the reasons. Also you can goto problems section and check the issues - Check this - www.eclipse.org/forums/index.php/t/206068/ www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/au16690_.htm
TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD from a http url, please do so by using the JVM argument [-Dtestng.dtd.http=true] at org.testng.xml.TestNGContentHandler.resolveEntity(TestNGContentHandler.java:114)
Hi Emad, have not used IntelliJ, but you can always create it manually and add the data. This can help menukablog.wordpress.com/2016/03/29/how-to-setup-testng-with-intellij-idea-beginners-guide/
@@RaghavPal When am trying to search on google through selenium automation, reCAPTCHA is enabled, i cant able to search, how can get rid of recaptcha validation/verfication.
@@RaghavPal Thank you sir for your time. Could you please rectify my other issue, How can we solve the issue that, when I try to import project another version of eclipse, my project is showing an error that org.seleniumhq.driver.RemoteDriver is not resolved. It is indirectly referenced from the .class file.
Hi Raghav, thank you for a great tutorial. I have a question though, I am trying to run a suite with mvn test -DsuiteXmlFile=testng.xml but it looks like it tries to run all the test classes and it gives me errors for all of them: No runnable methods [ERROR] .initializationError » InvalidTestClass .If I run the testng.xml by clicking on the 'run' icon as you do in the video, everything works fine. Also, I think I have a correct pom.xml, I've added testng.xml . I've got gut feeling it might be something with org.junit.runners.BlockJUnit4ClassRunner but actually I have no clue. Do you have any idea, what might be the issue?
Hi Luv The error message "No runnable methods" indicates that the test class does not contain any methods that can be run. This can happen for a few reasons, such as: * The test class does not have any @Test annotations. * The test class has @Test annotations, but the methods do not have any assertions. * The test class is not a subclass of TestCase or JUnit4TestCase. The error message "InvalidTestClass" indicates that the test class is invalid. This can happen for a few reasons, such as: * The test class does not have a public constructor. * The test class does not have a public void method named "test". * The test class is not annotated with @RunWith(Suite.class). If you are still getting the errors after checking these things, you can try the following: * Check the pom.xml file to make sure that the surefire plugin is configured correctly. * Try running the tests from a different IDE. * Try running the tests from the command line with the -Dtest= option to specify a specific test class. If you are still having trouble, you can search for the error message on the Maven website or on Stack Overflow to see if there are any other solutions. Here are some additional things you can check: * Make sure that you are using the latest version of Maven. * Try starting Maven manually and see if it runs the tests without any errors. * If you are using a proxy, make sure that the proxy settings are correct. * If you are using a firewall, make sure that it is not blocking Maven. I hope this helps! Based on the information you provided, it seems like the issue might be with the org.junit.runners.BlockJUnit4ClassRunner class. This class is used to run JUnit 4 tests, and it might not be compatible with the testng.xml file that you are using. You can try using a different test runner, such as the org.testng.TestNG class. You can also try running the tests from a different IDE. This can help you to isolate the issue and determine if it is a problem with Maven or with your test code. If you are still having trouble, you can search for the error message on the Maven website or on Stack Overflow to see if there are any other solutions.
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.
Thanks a ton Deepak
As always, one more simple yet effective learning experience. Thank you for sharing.
Glad you enjoyed it..
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 :)
Yes Ahmed, will do it soon
thanks for your efforts sir
@@RaghavPal Hi Raghav, Would you please give me the link if you made a video for a real project with a lot of test cases.
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
Hi Raman, yes we can do to run specific tests. Like smoke, sanity, regression suite etc. You can just copy the command to run testng.xml in jenkins. See more videos in this playlist
Thaanq for the video.....it is reaaly helpful
Most welcome
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
Hi Ganesh, you will need to call the browser setup code both times when running in parallel. I will need to check more, You can try some online help meanwhile
clear explanation
thanks for watching
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
Hi KR Mario, its a chrome extension Momentum
Thank you so much. I’ll give it a try.
very helpful..
Thanks for watching
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?
Hi Shaji, the file is not created internally unless you create it
Hi Sir please make a video on complete Java OOPS concept which is frequently asked in Interviews
Sure Wasim, I will do
Thanks for your Reply Sir waiting for video please make video as early as possible
Very useful 👍👍
Thanks Prakash
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.
Hi Anil, you can make test 3 dependent on test 2. This is shown in later videos of this series
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: java.lang.IllegalStateException: The driver executable does not exist: C:\Users
ebeka\Downloads\ESTADAO\AUTOM1\drivers\geckodriver\chromedriver.exe
Hi Rebeka, pls check this - stackoverflow.com/questions/51607304/java-lang-illegalstateexception-the-driver-executable-does-not-exist-while-try
This one might not be directly related to your issue but will help in the concept - github.com/cbeust/testng/issues/1336
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?
Hi Shaji, Yes, if you are running in parallel, but this will be limited by system configuration, hardware
Hi raghav,
Convert to testng option not opening ganarate testng.xml file window is not opening
Need help to solve this
Hi Pravin, will need to check the setup again
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.
This is error log : test.TestNG_Demo:googleSearchTest
element not interactable (Session info: chrome=83.0.4103.106) Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' System info: host: 'DESKTOP-VQ1BN74', ip: '192.168.0.111', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_231' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities [{networkConnectionEnabled=false, chrome={chromedriverVersion=83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}), userDataDir=C:\Users\dungntt\AppData\Local\Temp\scoped_dir16080_409941723}, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss and notify, strictFileInteractability=false, platform=ANY, proxy=Proxy(), goog:chromeOptions={debuggerAddress=localhost:60228}, acceptInsecureCerts=false, browserVersion=83.0.4103.106, browserName=chrome, javascriptEnabled=true, platformName=windows, setWindowRect=true, webauthn:virtualAuthenticators=true}] Session ID: fecd8b4e5f6fd6f0486cd5cb93fb301f
Hi Thanh, the logs says element not interactable
Can you please check the setup again and also compare all steps with the video
Very easy👍👍🙏🙏🙏
Thanks Manisha
@@RaghavPal cleared the interview becoz of you thanks
Good video, thanks
You're welcome
Hi Raghav, Is it possible to execute my parallel test cases on different browsers?
Yes you can Rahul
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.
Hi Mohammad, will need to check, what is the error, do you see the logs
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 I love watching Automation Step by Step video tutorial because Raghav gives sufficient information 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!!!
Hi Senzo, I will try to do a general session. The xpath videos will also help you. ruclips.net/p/PLhW3qG5bs-L83gLEZVIDHOvgTTz27po_0
Thanks, Raghav I will be glad if you can do the general session.
org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- I am getting this error when clicking Run As on testng.xml
Hi Rudraksh, this most possibly is issue with your testng.xml file. Pls check this -stackoverflow.com/questions/49339698/org-testng-testngexception-sun-security-provider-certpath-suncertpathbuilderexc
When a create testNg_Demo2 from testNg_Demo, and put the testNg_demo2 in testng.xml (
and run, I have the following error below.: error: java.lang.IllegalStateException: The driver executable does not exist: C:\Users
ebeka\Downloads\ESTADAO\AUTOM1\drivers\geckodriver\chromedriver.exe
Hi Rebeka, pls check the other comment
I sir I downloaded eclipse,jdk, selenium, chrome. M I writing the code click the run but showing errors lines
Hi Vinay, when you hover over the error or click on it, you will get the reasons. Also you can goto problems section and check the issues - Check this - www.eclipse.org/forums/index.php/t/206068/
www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/au16690_.htm
good example
Thanks Anil
Hi Raghav Pal, i have created testng.xml and added the code and when I run as testngsuite im getting the following error
TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD from a http url, please do so by using the JVM argument [-Dtestng.dtd.http=true]
at org.testng.xml.TestNGContentHandler.resolveEntity(TestNGContentHandler.java:114)
Hi Vamshi, I checked for this online, This can help stackoverflow.com/questions/57299606/testng-by-default-disables-loading-dtd-from-unsecure-urls
I am getting "Cannot find class in classpath:" error plz help me how to over come from this exception
Hi Akash, there must be some particular class, Pls check the entire log
I am working on IntelliJ IDE, how to generate testNG.xml file?
Hi Emad, have not used IntelliJ, but you can always create it manually and add the data. This can help menukablog.wordpress.com/2016/03/29/how-to-setup-testng-with-intellij-idea-beginners-guide/
@@RaghavPal thank you very much
What does threadcount for?
Hi Poornima, it shows number of treads (virtual users)
Hi sir , How to run multiple classes in xml
Hi Shivu, can add the classes in testng.xml
@@RaghavPal Thank you Sir
Thank you sir
you're welcome Rakesh
asking for recaptcha solving
need more details Kamal
@@RaghavPal When am trying to search on google through selenium automation, reCAPTCHA is enabled, i cant able to search, how can get rid of recaptcha validation/verfication.
I believe that might be due to your browser or system settings as google application does not have anything like that. Pls check
@@RaghavPal Thank you sir for your time. Could you please rectify my other issue, How can we solve the issue that, when I try to import project another version of eclipse, my project is showing an error that org.seleniumhq.driver.RemoteDriver is not resolved. It is indirectly referenced from the .class file.
Hi Kamal, I hope you are using maven. Once you goto new eclipse pls run maven commands to compile and build project again
:)
Hi Raghav, thank you for a great tutorial. I have a question though, I am trying to run a suite with mvn test -DsuiteXmlFile=testng.xml but it looks like it tries to run all the test classes and it gives me errors for all of them: No runnable methods [ERROR] .initializationError » InvalidTestClass .If I run the testng.xml by clicking on the 'run' icon as you do in the video, everything works fine. Also, I think I have a correct pom.xml, I've added testng.xml . I've got gut feeling it might be something with org.junit.runners.BlockJUnit4ClassRunner but actually I have no clue. Do you have any idea, what might be the issue?
Hi Luv
The error message "No runnable methods" indicates that the test class does not contain any methods that can be run. This can happen for a few reasons, such as:
* The test class does not have any @Test annotations.
* The test class has @Test annotations, but the methods do not have any assertions.
* The test class is not a subclass of TestCase or JUnit4TestCase.
The error message "InvalidTestClass" indicates that the test class is invalid. This can happen for a few reasons, such as:
* The test class does not have a public constructor.
* The test class does not have a public void method named "test".
* The test class is not annotated with @RunWith(Suite.class).
If you are still getting the errors after checking these things, you can try the following:
* Check the pom.xml file to make sure that the surefire plugin is configured correctly.
* Try running the tests from a different IDE.
* Try running the tests from the command line with the -Dtest= option to specify a specific test class.
If you are still having trouble, you can search for the error message on the Maven website or on Stack Overflow to see if there are any other solutions.
Here are some additional things you can check:
* Make sure that you are using the latest version of Maven.
* Try starting Maven manually and see if it runs the tests without any errors.
* If you are using a proxy, make sure that the proxy settings are correct.
* If you are using a firewall, make sure that it is not blocking Maven.
I hope this helps!
Based on the information you provided, it seems like the issue might be with the org.junit.runners.BlockJUnit4ClassRunner class. This class is used to run JUnit 4 tests, and it might not be compatible with the testng.xml file that you are using. You can try using a different test runner, such as the org.testng.TestNG class.
You can also try running the tests from a different IDE. This can help you to isolate the issue and determine if it is a problem with Maven or with your test code.
If you are still having trouble, you can search for the error message on the Maven website or on Stack Overflow to see if there are any other solutions.
xml is not visible in other-->wizard. can you please help me to resolve?
Hi Sai, pls check if testng plugin is added in eclipse
Though i click convert to testng still xml file is not getting created
pls check the setup again and try