Cucumber TestNG Extent Report using Adapter

Profile picture for user devraj

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

Video Tutorial: Generate Extent Report in Cucumber TestNG