Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

cucumber.runtime.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter. It does not implement cucumber.api.Plugin #116

Open
nrajendranviasat opened this issue Jan 6, 2020 · 2 comments

Comments

@nrajendranviasat
Copy link

Runner class

@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:target/cucumber-reports/report.html"},
features = "src/test/resources/features/",
glue = {"com.test"}
)
public class RunnerClassTest{
@afterclass
public static void writeExtentReport() {
System.out.println("hello i m in write///...");
try {
//Reporter.loadXMLConfig(new File(FileReaderManager.getInstance().getConfigReader().getReportConfigPath()));
System.out.println("dfhafjgj... " + Reporter.class.toString());
Reporter.loadXMLConfig(new File("C:\Projects\CommunityWIFI\code\cwf-automation-tests\configs\extent-config.xml"));
}
catch(Exception e){
e.printStackTrace();
}
Reporter.setSystemInfo("User Name", System.getProperty("user.name"));
Reporter.setSystemInfo("Time Zone", System.getProperty("user.timezone"));
Reporter.setSystemInfo("Machine", "Windows 10" + "64 Bit");
Reporter.setSystemInfo("Selenium", "3.7.0");
Reporter.setSystemInfo("Maven", "3.5.2");
Reporter.setSystemInfo("Java Version", "1.8.0_151");
}

pom.xml

com.vimalselvam cucumber-extentsreport 3.1.1 com.aventstack extentreports 3.1.1
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.2</version>
    </dependency>
io.cucumber cucumber-junit 3.0.2 test
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>3.0.2</version>
        <scope>test</scope>
    </dependency>


    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-jvm</artifactId>
        <version>3.0.2</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>5.0.1</version>
        <type>pom</type>
    </dependency>

Getting below Exception

cucumber.runtime.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter. It does not implement cucumber.api.Plugin

at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:179)
at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:166)
at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:223)
at cucumber.runtime.formatter.PluginFactory.isFormatterName(PluginFactory.java:201)
at cucumber.runtime.RuntimeOptionsFactory.addPlugins(RuntimeOptionsFactory.java:89)
at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:37)
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:24)
at cucumber.api.junit.Cucumber.<init>(Cucumber.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
@nrajendranviasat
Copy link
Author

nrajendranviasat commented Jan 7, 2020 via email

@nrajendranviasat
Copy link
Author

Its already present.
I have modified the adapter to adapter3,
Now I am getting

java.lang.NullPointerException
at com.vimalselvam.cucumber.listener.Reporter.loadXMLConfig(Reporter.java:57)
at com.test.StagingAppTestSuite.writeExtentReport(StagingAppTestSuite.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)

Process finished with exit code -1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant