Extent Reports Using Selenium and Cucumber BDD

Introduction to Extent Reports:

Extent Report is an open-source reporting library used in Selenium and Cucumber frameworks for generating HTML reports for test executions.

It provides a comprehensive and interactive report that displays the test execution results in an organized manner with charts and graphs, which makes it easier for users to analyze and understand the results.

Extent Report provides the following features:

  • Customizable reports: Users can customize the look and feel of the reports based on their requirements.
  • Rich visualization: Reports include detailed charts and graphs that help users to understand the test execution results easily.
  • Real-time reporting: The report gets updated in real-time as the tests run, making it easy to track the progress of the test execution.
  • Easy integration: Extent Reports can be easily integrated with other testing frameworks like Selenium and Cucumber.

Here is an example of how to use Extent Report in a Cucumber framework:

1. Add the Extent Report and Cucumber7 Adapter dependency to the pom.xml file like the below:


2. Create an ExtentReport.properties file and Enter the below data in the property file:

basefolder.datetimepattern=d-MMM-YY HH-mm-ss
systeminfo.Engineer= yourname

3. Add the Extent Report in Cucumber Runner Class in the plugin field like below:

package runner;
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import util.Hooks;
					,tags= "@mobile"
public class TestRunner{

Run the Cucumber tests, and the Extent Report will be generated in the specified location as per the location mentioned in the ExtentReport property file.

Conclusion:  Extent Report is an excellent tool for generating interactive reports that help testers to analyze test results quickly and efficiently. Its customizable reporting features and easy integration with other testing frameworks make it an ideal choice for test automation.

Post a Comment

Post a Comment (0)

Previous Post Next Post