O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – running testng.xml through the command prompt

Perform the following steps for running testng.xml through the command prompt:

  1. Open the command prompt on your system.
  2. Go to the Test Java project folder where the new testng.xml is created.
  3. Type the following line.
    java -cp "/opt/testng-6.8.jar:bin" org.testng.TestNG testng.xml
    

    In the preceding command we are adding the TestNG JAR and the project compiled code to the Java classpath by using the -cp option of Java.

    Here /opt/testng-6.8.jar is the path to the testng JAR where you had downloaded it and it may be different for your system. Also, bin is the folder containing the compiled code of the Java project. This can be found under the Eclipse project, which is under consideration. We ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required