简体   繁体   中英

I can't run testng.xml, getting error java.lang.NoSuchMethodError

This is my project structure

When i am trying to run testng.xml, I am getting the below error :

[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"

Is this happening because of testng version conflicts? I am stuck on this since past many days.

On console : detected TestNG version 6.8.2 and in your folder structure , it is : 6.12

You should update your TestNG jar and re-configure the latest one in your buildpath. You can download the latest from here .

You have to match your TestNG version install in Eclipse and your TestNG dependency.

You can't run TestNG dependency of 7.1.0 with TestNG Software 6.14 installed in your eclipse.

You can install your compatible TestNG version from here

Follow these steps to install/upgrade TestNG version in your eclipse:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM