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, please leave comments if anything needs to be added or updated, discuss your queries on our facebook:qavalidation.com, Thanks!

Leave a Reply

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

%d bloggers like this: