testng - 抽象方法错误

时间:2016-02-03 17:13:20

标签: java testng testng-eclipse

我试图创建一个testng类并在Eclipse中运行它,但我得到以下错误 -

java.lang.AbstractMethodError: org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/util/Collection;)Lorg/testng/TestRunner;
    at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:587)
    at org.testng.SuiteRunner.init(SuiteRunner.java:161)
    at org.testng.SuiteRunner.<init>(SuiteRunner.java:114)
    at org.testng.TestNG.createSuiteRunner(TestNG.java:1290)
    at org.testng.TestNG.createSuiteRunners(TestNG.java:1277)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1131)
    at org.testng.TestNG.run(TestNG.java:1048)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:115)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:207)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:178)

我的简单课程

package test.selenium_project;

import org.testng.annotations.Test;

public class SampleNg {
  @Test
  public void f() {
      System.out.println("test");
  }
}

使用jar

testng-6.5.1

1 个答案:

答案 0 :(得分:1)

我期待它与testng jar有关。你能用eclipse-testng addin尝试一下吗? here是安装插件的步骤

here是来自maven存储库的最新测试jar。

谢谢你, 穆拉利