TestNG Version
Note: only the latest version is supported
7.8.0
ExtentReport Version
Note: only the latest version is supported
3.3.0
Expected behavior
Should be able to execute test in parallel with testNG attributes groups and dependsOnGroups
Actual behavior
java.lang.NoSuchMethodError: com.aventstack.extentreports.ExtentTest.assignCategory([Ljava/lang/String;)Lcom/aventstack/extentreports/ExtentTest;
at com.vimalselvam.testng.listener.ExtentTestNgFormatter.afterInvocation(ExtentTestNgFormatter.java:193)
at org.testng.internal.invokers.InvokedMethodListenerInvoker$InvokeAfterInvocationWithoutContextStrategy.callMethod(InvokedMethodListenerInvoker.java:100)
at org.testng.internal.invokers.InvokedMethodListenerInvoker.invokeListener(InvokedMethodListenerInvoker.java:62)
at org.testng.internal.Invoker.runInvokedMethodListeners(Invoker.java:566)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:713)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Is the issue reproducible on runner?
Test case sample
Please, share the test case (as small as possible) which shows the issue
ReportsTest.java
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class ReportsTest extends GenericTest {
private GenericController genericController;
private ReportsController reportsController;
@BeforeMethod
public void beforeMethodReports(){
genericController = new GenericController(selDriver);
reportsController = new ReportsController(selDriver);
}
@Test(dataProvider = "testA", dataProviderClass = DataProviderCustom.class, groups = {"Reports"})
public void testA(String dataTestCaseName, ReportModel reportModel){
try {
// Setup
// Trigger
// Assertion
} catch (Exception ex) {
Utilities.printUnexpectedPageErrors(selDriver, dataTestCaseName, ex);
}
}
}
FileUploadTest.java
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class ReportsTest extends GenericTest {
private GenericController genericController;
private ReportsController reportsController;
@BeforeMethod
public void beforeMethodReports(){
genericController = new GenericController(selDriver);
reportsController = new ReportsController(selDriver);
}
@Test(dataProvider = "testB", dataProviderClass = DataProviderCustom.class, groups = {"FileUpload"}, dependsOnGroups = {"Reports"})
public void testB(String dataTestCaseName, ReportModel reportModel){
try {
// Setup
// Trigger
// Assertion
} catch (Exception ex) {
Utilities.printUnexpectedPageErrors(selDriver, dataTestCaseName, ex);
}
}
}
suite.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Selenium Webdriver Test" parallel="classes" thread-count="3">
<listeners>
<listener class-name="com.vimalselvam.testng.listener.ExtentTestNgFormatter" />
</listeners>
<test name="Test in FF">
<classes>
<class name="com.sample.test.FileUploadTest">
<methods>
<include name="testA"/>
</methods>
</class>
<class name="com.sample.test.ReportsTest">
<methods>
<include name="testA" />
</methods>
</class>
</classes>
</test>
</suite>
TestNG Version
ExtentReport Version
Expected behavior
Should be able to execute test in parallel with testNG attributes
groupsanddependsOnGroupsActual behavior
Is the issue reproducible on runner?
Test case sample
ReportsTest.java
FileUploadTest.java
suite.xml