This 是我的项目结构
当我尝试运行testng.xml时,我收到以下错误:
[RemoteTestNG] detected TestNG version 6.8.2
java.lang.NoSuchMethodError: org.testng.internal.IConfiguration.getConfigurationListeners()Ljava/util/List;
at org.testng.remote.support.RemoteTestNG6_5$1.newTestRunner(RemoteTestNG6_5.java:34)
at org.testng.remote.support.RemoteTestNG6_5$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_5.java:63)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:547)
at org.testng.SuiteRunner.init(SuiteRunner.java:142)
at org.testng.SuiteRunner.<init>(SuiteRunner.java:106)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1059)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1045)
at org.testng.TestNG.runSuitesLocally(TestNG.java:881)
at org.testng.TestNG.run(TestNG.java:824)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:"C:\Program Files (x86)\HP\Unified Functional Testing\bin\java_shared\classes";"C:\Program Files (x86)\HP\Unified Functional Testing\\bin\java_shared\classes\jasmine.jar"
这是因为testng版本冲突而发生的吗?过去很多天我一直坚持这个。
答案 0 :(得分:0)
在控制台上:detected TestNG version 6.8.2
在您的文件夹结构中,它是:6.12
您应该更新TestNG jar并重新配置buildpath中的最新jar。您可以从here下载最新内容。
答案 1 :(得分:0)