customize TestNG Report

Install TestNG Testing Framework on Eclipse IDE, TestNG Annotations, Create TestNG Test Cases, Prioritize TestNG Test Cases, Group TestNG Test Cases, Data Driven Testing, Parallel Testing and Generate Test Reports.
Post Reply
sekhar
Posts: 47
Joined: Mon Dec 31, 2018 6:40 am

customize TestNG Report

Post by sekhar » Sat Jan 05, 2019 7:12 am

How to customize TestNG Report?

kishore
Posts: 55
Joined: Thu Jan 03, 2019 3:57 am

Re: customize TestNG Report

Post by kishore » Tue Jan 08, 2019 12:24 pm

TestNG reporting is quite handy but still, sometimes we need some less data in reports or want to display reports in some other format like pdf, excel, etc. or want to change report's layout.

There can be two ways we can customize TestNG report

1.Using ITestListener Interface:
========================
We use this interface when we need to customize real-time report. In other words, if we are executing the bunch of test cases in a TetNG suite and we want to get the report of each test case, then after each test case we need to implement ITestListener interface. This interface will override onTestFailure, onTestStart, onTestSkipped method to send the correct status of the current test case.

2.Using IReporter Interface:
========================
If we want to customize final test report generated by TestNG, we need to implement IReporter interface. This interface has only one method to implement generateReport. This method has all the information of a complete test execution in the List<ISuite>, and we can generate the report using it.

Post Reply

Return to “TestNG Testing Framework for Selenium”