【问题标题】:I can't run testng.xml, getting error java.lang.NoSuchMethodError我无法运行 testng.xml,出现错误 java.lang.NoSuchMethodError
【发布时间】:2017-12-02 02:23:26
【问题描述】:

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 版本冲突吗?自从过去很多天以来,我一直坚持这一点。

【问题讨论】:

  • 从系统中的environment variables 中删除"C:\Program Files (x86)\HP\Unified Functional Testing\\bin\java_shared\classes\jasmine.jar"。它会给你带来更多问题如果你想使用 HP UFT,请重新打开它

标签: java xml selenium jboss testng


【解决方案1】:

在控制台上:detected TestNG version 6.8.2 在您的文件夹结构中,它是:6.12

您应该更新您的 TestNG jar 并在构建路径中重新配置最新的。您可以从here下载最新的。

【讨论】:

    【解决方案2】:

    您必须匹配您在 Eclipse 中安装的 TestNG 版本和您的 TestNG 依赖项。

    在 Eclipse 中安装了 TestNG Software 6.14 后,您无法运行 7.1.0 的 TestNG 依赖项。

    您可以从 here 安装兼容的 TestNG 版本

    按照these的步骤在你的eclipse中安装/升级TestNG版本:

    【讨论】:

      猜你喜欢
      • 2017-09-19
      • 2011-09-05
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-29
      • 1970-01-01
      • 2021-07-18
      相关资源
      最近更新 更多