Reputation: 320
This is what i have done till now:
2.Now i first tried to run testng.xml using command-line with following command.
java -cp ".;C:\Users\A622965\.m2\repository\org\testng\testng\6.8\testng-6.8.jar" org.testng.TestNG testng.xml
3.But throws following error:
Error: Could not find or load main class org.testng.TestNG
Not able to figure out the issue after watching lot of tutorials.
I am looking to batch process the script using Task Schedular in Windows
Upvotes: 1
Views: 6908
Reputation: 8793
Remember that Maven is a build tool, so every single operation which requires the classpath must be done through Maven, wether if you want to execute it from the command line or from some GUI.
So, in your case you will find useful the Maven command line tool:
mvn <phases>
In your case:
mvn test
But remember to include first in the pom.xml
the testng
library dependency, and also to properly configure the surefire plugin.
Upvotes: 1
Reputation: 452
You need to build path for testng
Right click-->Build -->Libraries Tab-->Add External jar-->Then restart--it will work...
Upvotes: 0