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

Поділитися
Вставка
  • Опубліковано 3 січ 2025

КОМЕНТАРІ • 91

  • @deepakrai5175
    @deepakrai5175 4 роки тому +2

    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.

  • @flirtuall78
    @flirtuall78 10 місяців тому

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

    • @RaghavPal
      @RaghavPal  10 місяців тому

      Glad you enjoyed it..

  • @ahmedagamy2731
    @ahmedagamy2731 6 років тому +3

    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 :)

    • @RaghavPal
      @RaghavPal  6 років тому +3

      Yes Ahmed, will do it soon

    • @ahmedagamy2731
      @ahmedagamy2731 6 років тому +1

      thanks for your efforts sir

    • @mallikvenna3932
      @mallikvenna3932 4 роки тому +1

      @@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.

  • @foodandfrywithamna7469
    @foodandfrywithamna7469 3 роки тому

    Thaanq for the video.....it is reaaly helpful

  • @kakakapo5967
    @kakakapo5967 3 роки тому +1

    clear explanation

  • @M99999ks
    @M99999ks 3 роки тому

    Very easy👍👍🙏🙏🙏

    • @RaghavPal
      @RaghavPal  3 роки тому +1

      Thanks Manisha

    • @M99999ks
      @M99999ks 3 роки тому

      @@RaghavPal cleared the interview becoz of you thanks

  • @ganeshadsule9414
    @ganeshadsule9414 4 роки тому +1

    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

    • @RaghavPal
      @RaghavPal  4 роки тому

      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

  • @prakashvish3988
    @prakashvish3988 3 роки тому

    Very useful 👍👍

  • @ramanwalia007
    @ramanwalia007 4 роки тому +1

    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

    • @RaghavPal
      @RaghavPal  4 роки тому

      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

  • @pravinjadhav9749
    @pravinjadhav9749 3 роки тому

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

    • @RaghavPal
      @RaghavPal  3 роки тому

      Hi Pravin, will need to check the setup again

  • @MidnightMemories17
    @MidnightMemories17 2 місяці тому

    very helpful..

    • @RaghavPal
      @RaghavPal  2 місяці тому

      Thanks for watching

  • @poornimanagesh8457
    @poornimanagesh8457 3 роки тому

    What does threadcount for?

    • @RaghavPal
      @RaghavPal  3 роки тому

      Hi Poornima, it shows number of treads (virtual users)

  • @buma1306
    @buma1306 5 років тому +1

    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

    • @RaghavPal
      @RaghavPal  5 років тому +1

      Hi KR Mario, its a chrome extension Momentum

    • @buma1306
      @buma1306 5 років тому

      Thank you so much. I’ll give it a try.

  • @rahulsikarwar6349
    @rahulsikarwar6349 4 роки тому

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

  • @starSha1982
    @starSha1982 4 роки тому

    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?

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Shaji, the file is not created internally unless you create it

  • @Robert723
    @Robert723 4 роки тому

    Good video, thanks

  • @starSha1982
    @starSha1982 4 роки тому

    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?

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Shaji, Yes, if you are running in parallel, but this will be limited by system configuration, hardware

  • @mohammadsalman2380
    @mohammadsalman2380 4 роки тому

    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.

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Mohammad, will need to check, what is the error, do you see the logs

  • @rebekamontana7656
    @rebekamontana7656 5 років тому

    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

    • @RaghavPal
      @RaghavPal  5 років тому

      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

  • @yernintianil
    @yernintianil 3 роки тому

    good example

  • @vamshikrishnapallerla8106
    @vamshikrishnapallerla8106 4 роки тому

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

    • @vamshikrishnapallerla8106
      @vamshikrishnapallerla8106 4 роки тому

      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)

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Vamshi, I checked for this online, This can help stackoverflow.com/questions/57299606/testng-by-default-disables-loading-dtd-from-unsecure-urls

  • @wasimakram-nz5gq
    @wasimakram-nz5gq 4 роки тому

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

    • @RaghavPal
      @RaghavPal  4 роки тому

      Sure Wasim, I will do

    • @wasimakram-nz5gq
      @wasimakram-nz5gq 4 роки тому

      Thanks for your Reply Sir waiting for video please make video as early as possible

  • @AnilKumar-sf4em
    @AnilKumar-sf4em 4 роки тому

    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.

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Anil, you can make test 3 dependent on test 2. This is shown in later videos of this series

  • @rebekamontana7656
    @rebekamontana7656 5 років тому

    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

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Rebeka, pls check the other comment

  • @rudrakshgandhar3381
    @rudrakshgandhar3381 5 років тому

    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

    • @RaghavPal
      @RaghavPal  5 років тому

      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

  • @emadrawashdeh4226
    @emadrawashdeh4226 6 років тому

    I am working on IntelliJ IDE, how to generate testNG.xml file?

    • @RaghavPal
      @RaghavPal  6 років тому +1

      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/

    • @emadrawashdeh4226
      @emadrawashdeh4226 6 років тому +1

      @@RaghavPal thank you very much

  • @vinaykrishna9782
    @vinaykrishna9782 4 роки тому

    I sir I downloaded eclipse,jdk, selenium, chrome. M I writing the code click the run but showing errors lines

    • @RaghavPal
      @RaghavPal  4 роки тому

      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

  • @thanhdungnguyenthi5452
    @thanhdungnguyenthi5452 4 роки тому

    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.

    • @thanhdungnguyenthi5452
      @thanhdungnguyenthi5452 4 роки тому

      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

    • @RaghavPal
      @RaghavPal  4 роки тому +1

      Hi Thanh, the logs says element not interactable
      Can you please check the setup again and also compare all steps with the video

  • @shivushankar4954
    @shivushankar4954 3 роки тому

    Hi sir , How to run multiple classes in xml

    • @RaghavPal
      @RaghavPal  3 роки тому

      Hi Shivu, can add the classes in testng.xml

    • @shivushankar4954
      @shivushankar4954 3 роки тому

      @@RaghavPal Thank you Sir

  • @akashsihol6834
    @akashsihol6834 5 років тому

    I am getting "Cannot find class in classpath:" error plz help me how to over come from this exception

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Akash, there must be some particular class, Pls check the entire log

  • @senzontuli
    @senzontuli 4 роки тому

    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!!!

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Senzo, I will try to do a general session. The xpath videos will also help you. ua-cam.com/play/PLhW3qG5bs-L83gLEZVIDHOvgTTz27po_0.html

    • @senzontuli
      @senzontuli 4 роки тому

      Thanks, Raghav I will be glad if you can do the general session.

  • @r_154
    @r_154 6 років тому

    Thank you sir

    • @RaghavPal
      @RaghavPal  6 років тому

      you're welcome Rakesh

  • @kamalnathlp6814
    @kamalnathlp6814 5 років тому

    asking for recaptcha solving

    • @RaghavPal
      @RaghavPal  5 років тому

      need more details Kamal

    • @kamalnathlp6814
      @kamalnathlp6814 5 років тому

      @@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
      @RaghavPal  5 років тому

      I believe that might be due to your browser or system settings as google application does not have anything like that. Pls check

    • @kamalnathlp6814
      @kamalnathlp6814 5 років тому

      @@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.

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Kamal, I hope you are using maven. Once you goto new eclipse pls run maven commands to compile and build project again

  • @Deniz-ss1sv
    @Deniz-ss1sv 3 роки тому

    :)

  • @luv966
    @luv966 Рік тому

    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?

    • @RaghavPal
      @RaghavPal  Рік тому

      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.

  • @subrahmanyamd1397
    @subrahmanyamd1397 3 роки тому

    Though i click convert to testng still xml file is not getting created

    • @RaghavPal
      @RaghavPal  3 роки тому

      pls check the setup again and try

  • @saiswaroopbedamatta3133
    @saiswaroopbedamatta3133 2 роки тому

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

    • @RaghavPal
      @RaghavPal  2 роки тому

      Hi Sai, pls check if testng plugin is added in eclipse