从命令提示符启动testng.xml

时间:2013-09-18 07:05:47

标签: command testng prompt

好的,我取得了一些进展,但仍然没有运气:

我的新命令行是: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: \工作空间\ Worx_AutoTest \的testng.xml

但结果是:

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

    [TestRunner] Running the tests in 'Smoke Test in FF - FF REMOTE' with par
    ode:false
    Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/sel
    ebDriver
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.testng.internal.XmlMethodSelector.checkMethod(XmlMethodSel
    ava:241)
    at org.testng.internal.XmlMethodSelector.setXmlClasses(XmlMethodS
    .java:259)
    at org.testng.TestRunner.initRunInfo(TestRunner.java:378)
    at org.testng.TestRunner.init(TestRunner.java:230)
    at org.testng.TestRunner.init(TestRunner.java:205)
    at org.testng.TestRunner.<init>(TestRunner.java:153)
    at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(
    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.WebDrive
    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)
    ... 17 more

1 个答案:

答案 0 :(得分:0)

Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selnium/WebDriver

您应该将selenium jar文件添加到classpath。这就是上面的消息所说的。