Getting error Could not find or load main class org.testng.TestNG

1
0

I’m trying to run TestNG from command line, but it’s giving me error.
Can someone tell me where am I going wrong?

java -cp C:/TestNG directory/testng-6.2.jar;C:\project directory\src\com\suites\suite\shop org.testng.TestNG testng.xml

Error: Could not find or load main class org.testng.TestNG

My scripts runs fine when I ran them from eclipse testng plugin.

  • You must to post comments
0
0

  1. Copy the below commands in a text file.

  2. Edit the location.

  3. Save it as yourtext.bat

  4. Now, double click on the batch file created.

cd C:\Workspace\projectname

java -cp C:\Workspace\projectname\lib*;C:\Workspace\projectname\bin org.testng.TestNG testng.xml

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website