Skip to main content

Cucumber TestNG Extent Report using Adapter

The Extent adapter which we have used for JUnit also exist for TestNG. You can generate extent report using TestNG listeners provided by Avent Stack or the plugin option by Grass Shopper. In this article we will do it using Avent Stack TestNG listener.

Here are the steps:

Step 1: Add following dependency to your pom.xml. You can check the latest one from here


Step 2: Add Extent ITestListener to your Runner class or to your TestNG.xml file

Runner Class

public class RunCucumberTest extends AbstractTestNGCucumberTests 



<suite name="Regression" parallel="none">
        <listener class-name="com.aventstack.extentreports.testng.listener.ExtentITestListenerClassAdapter"></listener>
     <test name="MyTest">
            <class name="com.pb.ctest.helper.RunCucumberTest" />

Step 3: Add file to src/test/resources


Step 4: Execute your runner class and check the output in given output folder

cucumber testng generate extent report

cucumber testng extent report generation

Submitted by tgoswami on January 23, 2022

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.


At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.