-2
FAILED CONFIGURATION: @BeforeClass baseBeforeClass(org.testng.TestRunner@74fe5c40)
java.lang.NoSuchMethodError: com.hp.lft.report.ReportingProvider.getInstance()Lcom/hp/lft/report/ReportingProvider;
    at com.hp.lft.unittesting.UnitTestBase.initReporter(UnitTestBase.java:314)
    at com.hp.lft.unittesting.TestNgUnitTestBase.classSetup(TestNgUnitTestBase.java:38)
    at unittesting.UnitTestClassBase.baseBeforeClass(UnitTestClassBase.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
    at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
    <... internal TestNG methods ...>
    at org.testng.TestNG.main(TestNG.java:1411)


FAILED CONFIGURATION: @AfterClass baseAfterClass(org.testng.TestRunner@74fe5c40)
java.lang.NoSuchMethodError: com.hp.lft.report.ReportingProvider.getInstance()Lcom/hp/lft/report/ReportingProvider;
    at com.hp.lft.unittesting.UnitTestBase.closeReportLevels(UnitTestBase.java:176)
    at com.hp.lft.unittesting.TestNgUnitTestBase.classTearDown(TestNgUnitTestBase.java:77)
    at unittesting.UnitTestClassBase.baseAfterClass(UnitTestClassBase.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
    at org.testng.internal.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:212)
    <... internal TestNG methods ...>
    at org.testng.TestNG.main(TestNG.java:1411)
4

1 回答 1

0

通过将正确的 jar 放入 CLASSPATH 解决了问题,主要问题是我使用的 jar 是旧 jar,因为它们内部没有 TestNG 注释方法。

解决方案:如果出现这种情况,请检查您的罐子是否具有这些方法,如果不使用具有这些方法的罐子。

于 2018-04-12T06:39:12.297 回答