remotewebdriver中的异常

时间:2013-11-20 12:07:00

标签: java eclipse

我正在尝试在虚拟机中运行测试脚本。我正在使用selenium server 2.34.0。任何帮助将不胜感激...
    但我得到这样的例外......

  

[TestNG]跑步:
  C:\ Users \用户nivid \应用程序数据\本地\ TEMP \ TestNG的-蚀 - 1565064710 \ TestNG的-customsuite.xml

FAILED CONFIGURATION: @BeforeSuite beforesuite
org.testng.TestNGException: 
Parameter 'targetBrowser' is required by @Configuration on method beforesuite but has not been marked @Optional or defined
in C:\Users\nivid\AppData\Local\Temp\testng-eclipse--1565064710\testng-customsuite.xml
    at org.testng.internal.Parameters.createParameters(Parameters.java:155)
    at org.testng.internal.Parameters.createParameters(Parameters.java:355)
    at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:86)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:199)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:277)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
    at org.testng.TestNG.run(TestNG.java:1022)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)

SKIPPED CONFIGURATION: @BeforeTest beforeTest
SKIPPED CONFIGURATION: @BeforeMethod beforemethod
SKIPPED CONFIGURATION: @AfterMethod aftermethod
SKIPPED: COPclientsearchTest

===============================================
    Default test
    Tests run: 1, Failures: 0, Skips: 1
    Configuration Failures: 1, Skips: 3
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 3
===============================================

[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@1e31bc4b: 70 ms
[TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 25 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter@1151000a: 8 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@52395294: 16 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@2786bf64: 13 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@3d78aa0f: 56 ms

1 个答案:

答案 0 :(得分:0)

看起来您可能需要将targetBrowser配置添加到xml ...

<suite name="mySuite" verbose="2" thread-count="5">
<parameter name="targetBrowser" value="FIREFOX" />