Getting error “cucumber.runtime.CucumberException: Couldn't load plugin class: com.cucumber.listener.ExtentCucumberFormatter.”

After many days searching for a solution to this problem that was also happening to me, I discovered the cause (at least that worked for me). Apparently, the pluggin com.cucumber.listener.ExtentCucumberFormatter or com.vimalselvam.cucumber.listener.ExtentCucumberFormatter (for cucumber-extentreports version 3.1.1+) only works with the cucumber of the info.cukes package.

<! - ->
<groupId>info.cukes</ groupId>
<version>1.2.5</ version>

To use ExtentReports with the most current cucumber versions (package io.cucumber from versions 2.X.X onwards) you need to add the cucumber-adapter plugin.

For each X version of cucumber, there is an adapter, such as for cucumber version 4.X.X the extentreports-cucumber4-adapter dependency is required.



And in the class Runner you should replace the plugin:




For an example of using cucumber 4 with extent reports follow the GitHub link I found:

For versions 2.X.X and 3.X.X follow the same principles as 4.X.X

ExtentReport settings specification link of all versions:

Hope this helps.

Advise is to upgrade your cucumber v to 4.x.x. Doing so would not only resolve your error rather you would be able to generate consolidated report during parallel execution as well without creating runners manually.

There are 2 ways of implementing extent report in Cucumber :

1. Using Cucumber-JVM 4 adapter for Extent Framework(extentreports-cucumber4-adapter) - Beauty is, you do not need to write any code any where to generate report this way except from setting adapter in runner below.

Add adapter dependency under POM.XML


Add the com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter plugin to the runner.

@CucumberOptions(plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"})
public class RunCukesTest {
    // ..

Report Output Directory - ../Project Directory/test-output/HtmlReport

2. Adding aventstack dependency under POM.XML


In this workflow, Do not Add the com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter plugin to the runner.