1
votes

I'm running the Maven project' TestNG suite in multiple nodes. I'm using the HTMLReporter to generate the TestNG run result report. Each node generates one HTML report after it's run completion.

The requirement to get a combined result report once the run is over. We need to combine all the test results into a single TestNG result.

Is there a way to achieve that?

1

1 Answers

0
votes

I had the similar requirement. I achieved it.

BaseTest is being extended by all the test class.

Class BaseTest{

            public static ExtentReports extent =new ExtentReports();//initiating here is very important
            public static ExtentHtmlReporter htmlReporter;

    @BeforeSuite
        public void beforeSuiteSetup() {
            String filepath = System.getProperty("user.dir");
            htmlReporter = new ExtentHtmlReporter(filepath+"/Report.html");     
            extent.attachReporter(htmlReporter);
        }

    @AfterSuite(alwaysRun = true)
        public void afterSuite() {
            extent.flush();
        }

    }