0
votes

I've created a simple testng project that prints out "Hello world". I can run the test from testng.xml successfully. I've tried to run the same test from command line but it fails. I've tried following all the tips given on this post. How to run TestNG from command line and multiple other posts but I'm still getting the same error. All my jar files are under lib and .class is under bin library. I've done everything most of the online help have suggested, for example create a script, testng.xml is there, make sure your jar files are under lib, and give a path to your bin folder. so what am I missing? Listed below is the command, image of my lib folder, image of the testng.xml and image of the error. Please help, I've been reading different posts since Friday.

java -cp C:\Eclipse\WorkSpace\TestingPractice\lib*;C:\Eclipse\WorkSpace\TestingPractice\bin org.testng.TestNG C:\Eclipse\WorkSpace\TestingPractice\testng.xml

enter image description here

My testng.xml file

enter image description here

enter image description here

1

1 Answers

0
votes

I was finally able to fix this by downloading the guice-4.2.2.jar and adding it to lib folder. Once I did that, it worked.

C:\Eclipse\WorkSpace\TestingPractice>set classpath=C:\Eclipse\WorkSpace\TestingPractice\bin;C:\Eclipse\WorkSpace\TestingPractice\lib* C:\Eclipse\WorkSpace\TestingPractice>java org.testng.TestNG C:\Eclipse\WorkSpace\TestingPractice\testng.xml