I'm getting Error: Could not find or load main class org.testng.TestNG with selenium-server-standalone-3.9.1.jar. But the same works fine with selenium-server-standalone-2.39.0.
Command i used to run from cmd: java -cp bin;jarslib/* org.testng.TestNG testng.xml
All the jars in my JarsLib folder.
Trying to execute my tests through cmd prompt. All the tests works fine inside the eclipse.
If i add 2.39V jar, and execute this, works fine. But if i use 3.9.1V jar, it simply gives an error " Error: Could not find or load main class org.testng.TestNG "
I don't know, what are all the new dependencies to make it run with 3.9.0V. It would be much helpful to list all the dependencies jars list, so that i can add to my work space.
I'm using Java-project. So handling dependencies is problem here.
Can some one helps me to fix this issue?
The problem is with your project's classpath. Selenium 2.39.0 used to be bundled with TestNG classes. That explains why things worked for you when you were using Selenium 2.39.0 everything was working fine.
jar -tf selenium-server-standalone-2.39.0.jar | grep -i 'org.testng.TestNG.class'
org/testng/TestNG.class
But the same is not true anymore with the latest selenium binaries. To get this sorted out you have two options.
jarslib
folder (You would need to download testng-6.14.2.jar, jcommander-1.72.jar and bsh-2.0b6.jar ] (or) and then try again.