Extent report plus parallel test (parallel = "tests")

Skip to first unread message

MCD dotCom

Sep 25, 2022, 7:36:05 PM9/25/22
to testng-users

I am having a problem with extent report running parallel tests using testng <test> tag. I am running the same test from different <test> tags. Extent report shows both same testng test methods in one extent test.

        <!-- https://mvnrepository.com/artifact/com.relevantcodes/extentreports -->

public class BaseTest2 extends Base{
    public static ExtentReports reporter;
    public ExtentTest loggerParent = null;
    public WebDriver driverGRID;
    public  static ExtentTest logger = null;

    public void initializeReport(){
        reporter = new ExtentReports("ExtentReport6.html", true, DisplayOrder.OLDEST_FIRST);

    public  void beforeMethod(Method method) {
        logger = reporter.startTest(method.getName()+randNum());

    public void beforeClass() throws MalformedURLException {    
        ITestResult itr = Reporter.getCurrentTestResult();
        String className = itr.getInstance().getClass().getName();
        loggerParent = reporter.startTest(className+randNum());
        loggerParent.log(LogStatus.INFO, "Before class");

public class FirstTest extends BaseTest{

    public void test1() {
        logger.log(LogStatus.INFO, "My first test");


public class SecondTest extends BaseTest2 {
    public void test1() {
        logger.log(LogStatus.INFO, "My second test");

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Access Regression Suite" parallel="tests">
    <test name="Test1">
            <class name="Grid.FirstTest" />

    <test name="Test2">
            <class name="Grid.FirstTest" />
            <class name="Grid.SecondTest" />

As you can see in testNG xml file, I have two different test tags but both calling the same test FirstTest. Please see the attached images(extent report) which show test method from FirstTest class is combined into one extent report test. 


⇜Krishnan Mahadevan⇝

Oct 2, 2022, 5:28:32 AM10/2/22
to testng...@googlegroups.com
Please post your query on the extent reports forum. TestNG does not own/maintain extent reports.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/7f42e86f-6c60-4550-93d3-1e13361d6462n%40googlegroups.com.

MCD dotCom

Oct 2, 2022, 2:07:19 PM10/2/22
to testng-users
Thank you!
Reply all
Reply to author
0 new messages