0
votes

I followed the instructions given in this post. But I get the message "Could not find or load main class org.testng.TestNG

Running test from CMD is quite easy.

Follow below steps

1- Go to home directory and Set class path

Home Directory > set classpath=Home Directory\bin; and press enter

Home Directory > set classpath=Home Directory\lib*; and press enter

2-Home-directory > java org.testng.TestNG testng.xml

http://learn-automation.com/execute-selenium-test

1

1 Answers

2
votes

You are overwriting the classpath you are setting in first statement (set classpath=Home Directory\bin) by second statement (set classpath= Home Directory\lib*)

What you can do is combine both separated with semicolon (;) set classpath=HomeDirectory\lib*;HomeDirectory\bin;

You can check what classpath is getting saved finally by just using 'set'