SELENIUM BASICS:


SELENIUM WEBDRIVER:


TESTNG:


REPORTS:


BUILD & CONTINUOUS INTEGRATION TOOLS:


CROSS BROWSER TESTING:


MOBILE TESTING:


AUTOMATION FRAMEWORKS:


API Testing:


INTERVIEW QUESTIONS:


SAMPLE RESUME:

How To Run TestNG Using Command Prompt | Software Testing Material

Goal: To Run TestNG using Command Prompt:

Steps to achieve our goal – Executing TestNG using Command Prompt:

  1. Open Eclipse and create a Java class
  2. Write a Java program
  3. Convert the Java Program into TestNG
  4. Open command prompt
  5. Run the TestNG using command prompt

Here is a video tutorial to learn “How To Run TestNG Using Command Prompt”:

Please be patient. The video will load in some time.

Step i: Open Eclipse and create a Java class

Step ii. Keep all the library files in a folder (here I create a folder name “lib”)

Step iii: Write a Java program

TestNG Using Command Prompt

Step iv: Convert the Java Program into TestNG

TestNG Using Command Prompt

Step v: Open command prompt

Step vi: Run the TestNG using command prompt

Also you could run TestNG using Batch file (.bat file)

Copy the below code and place it in a notepad and save the file using .bat extension

TestNG using command prompt

TestNG using command prompt

You could find the complete TestNG tutorial here.

TestNG Complete Tutorial

If you are not a regular reader of my blog then I highly recommend you to signup for the free email newsletter using the below link.

Sharing is caring.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

4 thoughts on “How To Run TestNG Using Command Prompt | Software Testing Material”

  1. i tried to add the all jar files in lib folder but i am getting Webdriver Exception cannot be resolved and also it’s not importing the pre-definied class

    • Share your code here vishnu

  2. Hello,

    Thank you so much ..
    Its working for me.
    But I am not able call back to back two classes from tesNG.xml throgh cmd

    • Follow my TestNG Tutorial. You have to place two classes in testng.xml file and call that testng.xml using command prompt.

Leave a Comment