In software test automation after completion of the test suite execution we need to have a report for the execution status and it is the only way of evidence for the pass and fail status of the tests. And most of the clients bother about the detailed report of the execution status. Most of the licensed automation testing tools will have in built rich report option to show the execution status. But coming to open source automation tools lacking in this option. Same way, Selenium also does not have the automation report generation option. But to execute the test suite, selenium is depending on unit testing frameworks like TestNG and Junit.
After test suite execution using TestNG or Junit, by default they will give the HTML reports, but the information provided by these reports are not so good. To avoid this, we are using XSLT reports, these are much better than normal TestNG and Junit reports.These will give a pie chart to represent the PASS,FAIL and SKIP test cases. Apart from this PIE Chart it will not give anymore information in the generated HTML report. If we want any other information we need to write separate code.
TestNG Default Report:
To overcome these type of issues, we can use Extent Reports. These are very good and rich HTML reports. By using these reports we can provide lot information to the reports. These will also give the status in the form of PIE Chart.
Below are the advantages provided by the Extent Reports:
- Status will be shown in the form of PIE chart.
- Can replace the existing report with the new report or append the new status to the existing report.
- We can change display order of the tests(i.e. oldest test at the top, newest at the end or newest test at the top, oldest at the end)
- Can generate ONLINE or OFFLINE reports.
- Can give the our own name to the test method (i.e can change the test method name in the report).
- Can generate stepwise log information in the report.
- Can segregate the tests using Test Categories.
- Can give test author name to display in the report.
- Can add a test node as a child of another test.
- Can insert any custom HTML in the logs by using an HTML tag.
- Can show the screenshots in the report wherever we need.
- Can add recording of your test runs in the report.
- Can add our own information in the report (i.e. version of selenium used, Environment information where the test suite executed).
- Can give our own name to the HTML report.
- It will give the System information in the report (i.e. HostName and OS used to execute the test suite.)
The above are the advantages provided by the extent reports. We can discuss all these things in the coming blogs.
You can find the complete information in the below link:
You can download the Extent Reports Jars in this link:
Last but not least, a big thanks to Anshoo Arora for giving this type of reports.
Please watch the YouTube video of this blog for better understanding.