Different ways to run testng.xml file

Basics of testng.xml is covered in last post, now let’s see different ways to run testng.xml

  • Using Eclipse IDE

In Eclipse, right click on the project, select Run As -> TestNG Test

  • Using command line (Run –> cmd)
Make sure you have created one folder (name as lib) under your project folder and place all your required jar  files (selenium and testng related).
          Then go to your project folder (Explorer window), SHIFT and right click on the explorer window, click on “Open command window here“, command prompt will open with the current project directory, then
type the following command to run your testng.xml
          [Let’s say my project is under, c:seleniumworkspacetestng]

  • Using ANT build

Refer post: Selenium testNG ANT reporting

  • Using Java code

Let’s move to more details on  testNG.xml


Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

1 Response

  1. June 26, 2018

    […] Now execute the code – Right click on the testng.xml, select “Run As” -> “TestNG Suite” and you are done! (for other ways of executing testng.xml, refer here) […]

Leave a Reply

Your email address will not be published. Required fields are marked *