Purpose and Process of Reporting:
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 test automation report generation option by-default. But to execute the test suite, selenium is depending on unit testing frameworks like TestNG and Junit.
Automation test engineers are supposed to test the application by running their automation test suit, find bugs and report it to team in such a manner that they can easily understand the execution result.
How Reporting Framework Helps Automation Test Report:
After test suite executions using TestNG or Junit, by default they will give the HTML reports, but the information provided by these extent reports are not so good in terms of one page summary of the test, though that can also be emailed to the team and stakeholders of the project but still have good scope of improvement.
To avoid this, we have other options like 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 any more information in the generated HTML report. If we want any other information we need to write separate code.
How Extent Report is an Add-On To Reporting:
To overcome above type of reporting issues, we would like to suggest using Extent Reports, that provide very interactive and one page email-able report. These are very good and rich HTML reports. By using these reports we can provide lot of information to the reports. These will also give the status in the form of PIE Charts, tables, list view and mixed mode.
Key Features of Extent Report:
In automation testing importance of reporting is so high. Reporting format varies from stage to stage. It may be category wise, types of testing involved or on individual basis. Graphical representation using pie charts, table and graphs make the presentation of report better and easy to understand.
a. Extent Report Can Be Integrated With TestNG:
Extent Report is an HTML reporting library for Selenium WebDriver for Java which is to a great degree simple to use and makes excellent execution reports. We can use this tool within our TestNG automation framework. We just need to define core objects of Extent Report in our automation framework after that we can call and user required features of Extent Reporting in our test scripts.
Extent Implementation with TestNG
As an automation tester its obligation to catch great reporting and present to administration group. So below are more interactive features that Extent Report provides and we need to know:
b. Below Are The Advantages Provided By The Extent Reports:
1. Status will be shown in the form of PIE chart.
2. Can replace the existing report with the new report or append the new status to the existing report.
3. 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)
4. Can generate ONLINE or OFFLINE reports.
5. Can give our own name to the test method (i.e. can change the test method name in the report).
6. Can generate stepwise log information in the report.
7. Can segregate the tests using Test Categories.
8. Can give author name to display in the report.
9. Can add a test node as a child of another test.
10. Can insert custom HTML in the logs by using an HTML tag.
11. Can show the screenshots in the report wherever we need.
12. Can add recording of your test runs in the report.
13. Can add our own information in the report.
14. Can give our own name to the HTML report.
15. It will give the System information in the report (i.e. HostName and OS used to execute the test suite.)
High Level Extent Test Report
c. Important Points To Be Remember:
1. Extent Reports will create the report file.
2. Extent Test will log the information in the report.
3. StartTest()method of ExtentReports class is the starting point of the test and it will return the ExtentTest object.
4. We need to capture that object into ExtentTest object.
5. Used this reference to log the information into the report.
6. ExtentReports object will be used to add the report information like Title, Header and Theme etc..
7. And the above configuration need to passed from the external XML file using loadConfig()method of ExtentReports class. It will take the XML file path as argument.
8. EndTest()method of ExtentReports will stop capturing information about the test log.
9. Flush()method of ExtentReports wil push/write everything to the document.
10. Close()method of ExtentReports will clear/close all resource of the ExtentReports object.
Log and List View of Extent Report
How To Read Extent Report:
Extent Report comes in HTML Format having 3 sections:
1. Dashboard : Overall Report of the Test Case
2. Category : Category wise Result
3. Tests : Individual Test Case Result
Overall Execution Report:
As you opens the HTML report you will be redirected to Dashboard. It will display overall execution report status.
It will display category-wise execution report status.
Individual Test-Case Result:
It will display individual execution report status. It’s a useful storehouse having an extraordinary Extent HTML report. Each association ought to utilize this report as yield of the UI Automation is in an easy to use report in which a non- technical or management people can understands easily which test case is working appropriately and which is not.