I would like to run TestNG Suite from command line on Linux. I'm using eclipse to run test, but I have problem with command line. I know that I need to have testng.jar and I have it in /home/karcio/dev/testng-6.4.jar, location my suite xml is /home/karcio/git/java-test-automation/Automation/test-output/Default suite/TestSuite.xml . Commands what I tried,
- set classpath
/home/karcio/dev/testng-6.4.jar - cd /location to my suite xml file:
java org.testing.TestNG TestSuite.xml
This is error what I see:
Exception in thread "main" java.lang.NoClassDefFoundError: org/testing/TestNG Caused by: java.lang.ClassNotFoundException: org.testing.TestNG
I'm new in those path and classpath, I'm little bit confusing :(
Thank you
Little update, I think I did all good, now when I put to terminal: java org.testng.TestNG Test.xml I've got this error:
Exception in thread "main" org.testng.TestNGException: No sourcedir was specified at org.testng.TestNG.checkConditions(TestNG.java:1170) at org.testng.TestNG.privateMain(TestNG.java:1010) at org.testng.TestNG.main(TestNG.java:997)
all path are exported, so maybe this is wrong version of testng.jar, tried with versions 5.5, 6.4, 6.5, 6.6, 6.7 but I think only version 5.5 is working,