0

As the title says I tried to follow the clues mentioned in

How to run TestNG from command line

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

Here is the detailed command I use:

java -cp "testng-6.8.jar:C:\Users\...\src\test\java\unit_tests\libs_test" org.testng.TestNG "C:\Users\...\src\test\resources\AllUnitTests.xml"

The point is that when I opened testng-6.8.jar in 7zip, I can see the org.testng.TestNG class:

screenshot

What is wrong with that command?

Krzysztof
  • 129
  • 2
  • 11
  • I think you should be using `;` (since you are on windows) instead of using `:` (which is applicable for UNIX) as a separator between the jars. See [here](https://stackoverflow.com/a/4528456/679824) – Krishnan Mahadevan Dec 15 '17 at 03:54
  • Thanks Krishnan, but that didin't help, although the error message is slightly different. Error: Unable to initialize main class org.testng.TestNG Caused by: java.lang.NoClassDefFoundError: com/beust/jcommander/ParameterException – Krzysztof Dec 15 '17 at 06:08

0 Answers0