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)
通过将正确的罐子放在类路径上来解决的问题,主要问题是我使用的罐子是旧罐子,因为它们没有testng注释方法。
解决方案:如果发生这种情况,请检查您的罐子是否使用这些方法是否使用这些方法。