running testng.xml from commandprompt

793 views
Skip to first unread message

goran gasparini

unread,
Sep 19, 2013, 10:32:02 AM9/19/13
to testng...@googlegroups.com
Hi guys,
My test suite works fine but i'd like to start the test session from a bat file that call the testng.xml  (that will be started from a scheduler)
But, I have some problems in this step, really cannot start it from cmd
Basically what I do is this!
 - java -cp C:\eclipse\plugins\org.testng.eclipse_6.8.6.20130607_0745/lib/testng.jar;C:\workspace\Worx_AutoTest\bin\ org.testng.TestNG C:\workspace\Worx_AutoTest\testng.xml

But, the result is the one below!
Any idea about what happens or maybe some suggestion !

Thanx

...
... TestNG 6.8.6beta_20130517_2142 by CÚdric Beust (ced...@beust.com)
...

[TestRunner] Running the tests in 'Smoke Test in FF - FF REMOTE' with parallel m
ode:false
[RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@5a36c9d5
 priority: 10
[[TestNGClassFinder]] Unable to read methods on class com.EvilTester.test.Accoun
tSettings_SmokeTest - unable to resolve class reference org/openqa/selenium/WebD
river
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/W
ebDriver
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.privateGetPublicMethods(Unknown Source)
        at java.lang.Class.getMethods(Unknown Source)
        at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:5
9)
        at org.testng.TestRunner.initMethods(TestRunner.java:409)
        at org.testng.TestRunner.init(TestRunner.java:235)
        at org.testng.TestRunner.init(TestRunner.java:205)
        at org.testng.TestRunner.<init>(TestRunner.java:153)
        at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRu
nner.java:538)
        at org.testng.SuiteRunner.init(SuiteRunner.java:157)
        at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)
        at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
        at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
        at org.testng.TestNG.run(TestNG.java:1057)
        at org.testng.TestNG.privateMain(TestNG.java:1364)
        at org.testng.TestNG.main(TestNG.java:1333)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.WebDriver
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 18 more

Tomek Kaczanowski

unread,
Sep 19, 2013, 10:40:24 AM9/19/13
to testng-users
Hi, you are missing webdriver/selenium JAR on your classpath

Cheers!

2013/9/19 goran gasparini <his...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to testng-users...@googlegroups.com.
> To post to this group, send email to testng...@googlegroups.com.
> Visit this group at http://groups.google.com/group/testng-users.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Regards / Pozdrawiam
Tomek Kaczanowski
http://practicalunittesting.com
Reply all
Reply to author
Forward
0 new messages