- Selenium Tutorial
- Selenium - Home
- Selenium - Overview
- Selenium - Components
- Selenium - Automation Testing
- Selenium - Environment Setup
- Selenium - Remote Control
- Selenium IDE Tutorial
- Selenium - IDE Introduction
- Selenium - Features
- Selenium - Limitations
- Selenium - Installation
- Selenium - Creating Tests
- Selenium - Creating Script
- Selenium - Store Variables
- Selenium - Alerts & Popups
- Selenium - Selenese Commands
- Selenium - Actions Commands
- Selenium - Accessors Commands
- Selenium - Assertions Commands
- Selenium - Assert/Verify Methods
- Selenium - Locating Strategies
- Selenium - Script Debugging
- Selenium - Verification Points
- Selenium - Pattern Matching
- Selenium - JSON Data File
- Selenium - Browser Execution
- Selenium - User Extensions
- Selenium - Code Export
- Selenium - JavaScript Functions
- Selenium - Plugins
- Selenium WebDriver Tutorial
- Selenium - Introduction
- Selenium WebDriver vs RC
- Selenium - Installation
- Selenium - First Test Script
- Selenium - Driver Sessions
- Selenium - Browser Options
- Selenium - Chrome Options
- Selenium - Edge Options
- Selenium - Firefox Options
- Selenium - Safari Options
- Selenium Web Elements
- Selenium - File Upload
- Selenium - Locator Strategies
- Selenium - Relative Locators
- Selenium - Finders
- Selenium - Find All Links
- Selenium - User Interactions
- Selenium - WebElement Commands
- Selenium - Browser Interactions
- Selenium - Browser Commands
- Selenium - Browser Navigation
- Selenium - Alerts & Popups
- Selenium - Handling Forms
- Selenium - Windows and Tabs
- Selenium - Handling Links
- Selenium - Input Boxes
- Selenium - Radio Button
- Selenium - Checkboxes
- Selenium - Dropdown Box
- Selenium - Handling IFrames
- Selenium - Handling Cookies
- Selenium - Date Time Picker
- Selenium - Dynamic Web Tables
- Selenium - Actions Class
- Selenium - Keyboard Events
- Selenium - Key Up/Down
- Selenium - Copy and Paste
- Selenium - Handle Special Keys
- Selenium - Mouse Events
- Selenium - Drag and Drop
- Selenium - Scroll Operations
- Selenium - Waiting Strategies
- Selenium - Explicit/Implicit Wait
- Selenium - Support Features
- Selenium - Multi Select
- Selenium - Wait Support
- Selenium - Color Support
- Selenium - Errors & Logging
- Selenium - Logging
- Selenium - Exception Handling
- Selenium - Miscellaneous
- Selenium - Handling Ajax Calls
- Selenium - JSON Data File
- Selenium - CSV Data File
- Selenium - Excel Data File
- Selenium - Cross Browser Testing
- Selenium - Multi Browser Testing
- Selenium - Multi Windows Testing
- Selenium - JavaScript Executor
- Selenium - Headless Execution
- Selenium - Capture Screenshots
- Selenium - Capture Videos
- Selenium - Page Object Model
- Selenium - Page Factory
- Selenium - Record & Playback
- Selenium - Frameworks
- Selenium - Browsing Context
- Selenium Grid Tutorial
- Selenium - Overview
- Selenium - Architecture
- Selenium - Components
- Selenium - Configuration
- Selenium - Create Test Script
- Selenium - Test Execution
- Selenium - Endpoints
- Selenium - Customizing a Node
- Selenium Reporting Tools
- Selenium - Reporting Tools
- Selenium - TestNG
- Selenium - JUnit
- Selenium - Allure
- Selenium & other Technologies
- Selenium - Java Tutorial
- Selenium - Python Tutorial
- Selenium - C# Tutorial
- Selenium - Javascript Tutorial
- Selenium - Kotlin Tutorial
- Selenium - Ruby Tutorial
- Selenium - Maven & Jenkins
- Selenium - Database Testing
- Selenium - LogExpert Logging
- Selenium - Log4j Logging
- Selenium - Robot Framework
- Selenium - AutoIT
- Selenium - Flash Testing
- Selenium - Apache Ant
- Selenium - Github
- Selenium - SoapUI
- Selenium - Cucumber
- Selenium - IntelliJ
- Selenium - XPath
- Selenium Miscellaneous Concepts
- Selenium - Automation Frameworks
- Selenium - Keyword Driven Framework
- Selenium - Data Driven Framework
- Selenium - Hybrid Driven Framework
- Selenium - SSL Certificate Error
- Selenium - Alternatives
- Selenium Useful Resources
- Selenium - Quick Guide
- Selenium - Useful Resources
- Selenium - Automation Practice
- Selenium - Discussion
Selenium - Reporting Tools
While we are running any automation tests using Selenium or any other tool, we will be required to view and analyze the results of the execution to conclude the number of tests which got executed, passed, failed, failure data, and so on in the form of reports.
Sometimes, the screenshots where the tests have undergone a failure are also captured in the reports. The test reports are also required to be shared with the project stakeholders on a periodic basis.
Reporting Tools Supported by Selenium
Allure Report
JUnit Report
TestNG Report
Allure Report
Allure can be used to create a detailed automation test report. It is an open source framework which can be integrated with Selenium tests and used for reporting purposes.
Prerequisites to Create Allure Report
Install Java(version above 8) in the system and check if it is present with the command: java -version. The java version installed will be visible if installation has been completed successfully.
Install maven in the system and check if it is present with the command: mvn -version. The maven version installed will be visible if installation has been completed successfully.
Install any IDE like Eclipse, IntelliJ, and so on.
Steps to Create Allure Report
Step 1 − We will need to create a maven project and add the proper dependencies to the pom.xml file for the below items −
TestNG Dependencies − Add the TestNG dependencies from the link: https://mvnrepository.com/artifact/.
Selenium Java Dependencies − Add the Selenium Java dependencies from the link: https://mvnrepository.com/artifact/
Allure TestNG Dependencies − Add the Allure TestNG dependencies from the link: https://mvnrepository.com/artifact/
Save the pom.xml with all the dependencies and update the maven project.
Step 2 − Download the Allure in the system. For Mac, and Linux, run the command: brew install allure. This will work provided Homebrew is available in the system. For Windows, run the command: scoop install allure. This will work provided Scoop is available in the system. Check if Allure is present with the command: allure –version. The Allure version installed will be visible if installation has been completed successfully..
Step 3 − Create a TestNG test class and run it through the testng.xml.
Step 4 − Refresh the project and a new folder called the allure-results should get generated in the project structure.
Step 5 − Run the command: allure serve from the project folder location.
A sample Allure report is shown in the below image.
JUnit Report
Junit can be used to create a detailed automation test report. It is an open source framework which can be integrated with Selenium tests and used for reporting purposes.
Prerequisites to Create JUnit Report
Install Java(version above 8) in the system and check if it is present with the command: java -version. The java version installed will be visible if installation has been completed successfully.
Install maven in the system and check if it is present with the command: mvn -version. The maven version installed will be visible if installation has been completed successfully.
Install any IDE like Eclipse, IntelliJ, and so on.
Steps to Create JUnit Report
Step 1 − Create a maven project and add the proper dependencies to the pom.xml file for the below items −
Selenium Java Dependencies − Add the Selenium Java dependencies from the link: https://mvnrepository.com/artifact/
JUnit Dependencies − Add the JUnit dependencies from the link: https://mvnrepository.com/artifact/.
JUnit Jupiter Dependencies − Add the JUnit Jupiter dependencies from the link: https://mvnrepository.com/artifact/.
Maven Site Dependencies − Add the Maven site dependencies from the link: https://mvnrepository.com/artifact/.
Maven Surefire Report Dependencies − Add the Maven Surefire Report dependencies from the link: https://mvnrepository.com/artifact/.
Save the pom.xml with all the dependencies and update the maven project.
Step 2 − Create a JUnit test class.
Step 3 − Run the test from the command line with the command: mvn clean test suite.
Step 4 − Refresh the project and a new folder called the site should get generated within the target folder in the project structure.
Step 5 − Right-click on the surefire-report.html and select the option to open in a browser.
A sample JUnit report is shown in the below image.
TestNG Report
A TestNG report is a html report generated automatically once a test case is built and run with the help of the TestNG. It is a unit testing framework which can be integrated with Selenium tests and used for reporting purposes.
In addition to this, the TestNG has a default reporting class called the Reporter which helps to log. This is useful in detecting the root cause of failure to debug the failed test.
Prerequisites to Create A TestNG Report
Install Java(version above 8) in the system and check if it is present with the command: java -version. The java version installed will be visible if installation has been completed successfully.
Install maven in the system and check if it is present with the command: mvn -version. The maven version installed will be visible if installation has been completed successfully.
Install any IDE like Eclipse, IntelliJ, and so on.
Add the TestNG dependencies from the link below: https://mvnrepository.com/artifact/org.testng/testng.
Add the Selenium Java dependencies from the below link : selenium-java
Save the pom.xml with all the dependencies and update the maven project
What are the Different Ways to Generate TestNG Reports?
The difference ways to generate a TestNG report are listed below −
emailable-report.html
index.html report
Reporter class report
emailable-report.html
The steps to create an emailable-report.html are listed below −
Step 1 − Create a TestNG test class and run it through the testng.xml.
Step 2 − Refresh the project and a new folder called the test-output should get generated in the project structure.
Step 3 − Right-click on the emailable-report.html and select the option to open in a browser.
A sample TestNG emailable-report.html is shown in the below image.
index.html report
The steps to create an index.html report are listed below −
Step 1 − Create a TestNG test class and run it through the testng.xml.
Step 2 − Refresh the project and a new folder called the test-output should get generated in the project structure.
Step 3 − Right-click on the index.html and select the option to open in a browser.
A sample TestNG index.html is shown in the below image.
Report Generated From Reporter Class
TestNG gives the Reporter class for logging purposes. It has four different ways to handle the information for logging −
Reporter.log( String str);
Reporter.log( String str, Boolean logToOut);
Reporter.log( String str, int l);
Reporter.log( String str, int l, Boolean logToOut);
The steps to generate log messages in report with Reporter class are listed below −
Step 1 − Create a TestNG test class with below log messages to be available in the reports and and run it through the testng.xml −
Moving to Registration Page.
Verified Login Page header.
Verified Register Page header.
Step 2 − Refresh the project and a new folder called the test-output should get generated in the project structure.
Step 3 − Right-click on the emailable-report.html and index.html to select the option to open in a browser.
A sample TestNG index.html and emailable-report.html along with log messages are shown in the below images.
index.html report
emailable-report.html
This concludes our comprehensive take on the tutorial on Selenium - Reporting Tools. We’ve started with describing different reporting tools supported by Selenium, such as Allure, JUnit, and TestNG reporting tools, prerequisites and steps to create TestNG, Allure, and JUnit reports along with Selenium. This equips you with in-depth knowledge of the reporting tools. It is wise to keep practicing what you’ve learned and exploring others relevant to Selenium to deepen your understanding and expand your horizons.
To Continue Learning Please Login
Login with Google