Welcome to Selenium tutorial, Today we will discuss how to generate report in selenium webdriver.
Automation without reporting of no use. Reporting plays very important role in Automation as well in Manual testing as well. Report help us to identify ROI and to prepare POC as well.
We can generate Advance reports as well like XSLT report which provide very good reporting.
I would highly recommend using Extent report which is a really very impressive report which is the advance version of XSLT report.
I have created a detailed video on TestNG which will help you to get started
Generate Report in Selenium Webdriver
Q1-Importance of Reporting in Selenium?
Ans-1- Reports helps you to identify the status of the test case (Pass/Fail/Skip).
2- Using reports we calculate time taken by each test case that helps to calculate ROI(Return on Investment).
3- You can share automation reports with your team and clients as well to share the status of testing progress etc.
Q2- Does selenium support report generation?
Ans- No Selenium will only help you to automate your web application. If you want to generate reports then we can use Third party tools that we can integrate and can generate reports.
Here TestNG comes into the picture.
Q3- Do we need to write some script or any additional code for reports?
Ans- No we do not have to write any additional code for report generation. We need to refresh our project and we will get 1 additional folder (default suite) inside that folder we will get all the reports.
One good feature about TestNG for every test case it creates 3 different type of reports.
Generate Report in selenium webdriver
Step 1- Create a Simple java class and write some test cases (in my case I have written 3 test case)
Step 2- To run script simply right click and select TestNG Test.
Step 3- Now test case will start execution and you will get console notification about the status and wait until the program is getting finished.
Report type 1- Console output.
Since console output is not useful because you can’t share and send to others so we required some HTML reports as well
TestNG guys already gave a solution for this so for even single test case you will get HTML reports as well.
Report type 2- HTML report
We have to refresh your project and reports folder will come automatically.
After refreshing, you will get below folder ready 🙂
Let’s open each report and check the content
Note- Open Each report in Web Browser select each report then right click and open in browser
Generate report in selenium webdriver
First open Default test.html
Second open emailable-report.html
Third, open Index.html
If you really think this article will help others too then please share this with others too.
For More updates Learn Automation page
For any query join Selenium group- Selenium Group