Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report is not being generated #1

Closed
adrian-arg opened this issue Nov 13, 2018 · 97 comments
Closed

Report is not being generated #1

adrian-arg opened this issue Nov 13, 2018 · 97 comments
Assignees
Labels
question Further information is requested

Comments

@adrian-arg
Copy link

Cucumber4-Adapter is not generating the desired report

I had managed to make the previous version work a few weeks ago.

All dependencies have been updated according to the information in the repository.

/* Runner Class */
@RunWith(Cucumber.class)
@CucumberOptions(
// junit = "--step-notifications",
strict = true
, features = { Environment.featuresFolder }
, glue = { Environment.stepDefinitionsFolder }
, tags = { "@regression"}
, monochrome = true
, plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",
}
)
public class Release_Runner extends AbstractTestNGCucumberTests{
}

/* extent.properties */
extent.reporter.avent.start=true
#extent.reporter.avent.config=avent-config.xml
extent.reporter.avent.out=test-output/AventReport/

@foursyth
Copy link

foursyth commented Nov 13, 2018

Ah, I see what the issue is..

AventReporter is not available in community version and what you see is only a place holder for users who upgrade/downgrade to/from professional edition. Use the below properties and it will work:

extent.reporter.html.start=true
extent.reporter.html.config=
extent.reporter.html.out=test-output/HtmlReport/ExtentHtml.html

extent.reporter.logger.start=true
extent.reporter.logger.config=
extent.reporter.logger.out=test-output/LoggerReport/

I have also created small example project here which you can use as reference although you won't be needing it.

@anshooarora anshooarora added the question Further information is requested label Nov 13, 2018
@adrian-arg
Copy link
Author

Ah, I see what the issue is..

AventReporter is not available in community version and what you see is only a place holder for users who upgrade/downgrade to/from professional edition. Use the below properties and it will work:

extent.reporter.html.start=true
extent.reporter.html.config=
extent.reporter.html.out=test-output/HtmlReport/ExtentHtml.html

extent.reporter.logger.start=true
extent.reporter.logger.config=
extent.reporter.logger.out=test-output/LoggerReport/

I have also created small example project here which you can use as reference although you won't be needing it.

Thank you, foursyth.
But still no luck, the only difference now is that it creates the output folders, but the report isn't there.

extent.reporter.email.out=test-output/EmailReport/ExtentEmail.html
extent.reporter.html.out=test-output/HtmlReport/ExtentHtml.html

I double checked all dependencies and removed any unnecessary ones.

@foursyth
Copy link

Can you share the new propeties file you have?

Having output folders is a good thing! We're almost there.

@foursyth
Copy link

One more thing. Are you running from command line or an IDE?

@adrian-arg
Copy link
Author

I copied the one in the example project, I tried commenting the config part just in case, but same result.
I'm running in Eclipse.

extent.reporter.avent.start=false
extent.reporter.bdd.start=false
extent.reporter.cards.start=false
extent.reporter.email.start=false
extent.reporter.html.start=true
extent.reporter.klov.start=false
extent.reporter.logger.start=true
extent.reporter.tabular.start=false

extent.reporter.avent.config=
extent.reporter.bdd.config=
extent.reporter.cards.config=
extent.reporter.email.config=
extent.reporter.html.config=
extent.reporter.klov.config=
extent.reporter.logger.config=
extent.reporter.tabular.config=

extent.reporter.avent.out=test-output/AventReport/
extent.reporter.bdd.out=test-output/BddReport/
extent.reporter.cards.out=test-output/CardsReport/
extent.reporter.email.out=test-output/EmailReport/ExtentEmail.html
extent.reporter.html.out=test-output/HtmlReport/ExtentHtml.html
extent.reporter.logger.out=test-output/LoggerReport/
extent.reporter.tabular.out=test-output/TabularReport/

@foursyth
Copy link

Hmm, Eclipse works for me.

Does the example project create the reports for you?

@adrian-arg
Copy link
Author

adrian-arg commented Nov 14, 2018

The example project works with Cucumber2 Adapter.

But if I change it to Cucumber4 Adapter it doesn't.

There seems to be some dependencies inconsistencies,
If I leave the pom as:

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.1</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>${cucumber.version}</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${cucumber.version}</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>${cucumber.version}</version>
        <scope>test</scope>
    </dependency>

It downloads cucumber v2.3.1 dependencies.

If I edit the POM file and bring the cucumber v4 dependencies, it doesn't work either

(Leaving aside that cucumber.api.format and others seem to be no longer available)

@foursyth
Copy link

Hmm, it should be the same. Let me try with version 4 adapter also.

@foursyth
Copy link

ello @adrian-arg

Hope you did not have to wait for too long. I got caught up with a few things.

Here is an example you can use: https://github.com/foursyth/extentreports-cucumber4-example

You can see test-output/ for the reports that got generated as per extent.properties. I hope this will help you.

@adrian-arg
Copy link
Author

adrian-arg commented Nov 14, 2018 via email

@adrian-arg
Copy link
Author

It seems I run into an Eclipse bug, may I ask which version are you running?

I'm on Version: Oxygen.3a Release (4.7.3a) - Build id: 20180405-1200

--
Class ParameterTypes.java >> import io.cucumber.datatable.DataTableType;

Internal compiler error: java.lang.ArrayIndexOutOfBoundsException

https://bugs.eclipse.org/bugs/show_bug.cgi?id=538192

@adrian-arg
Copy link
Author

I tried it on another machine.

It throws a ClassNotFoundException regarding the Runner

@adrian-arg
Copy link
Author

adrian-arg commented Nov 15, 2018

@foursyth

Well, I went ahead and tried it on my project.
It seems that something is not working, I can't pin point what it is,
but depending on the feature it just plain doesn't work, it doesn't output the stack-trace to console or generated the report.

If I run Features A and B it generates the report correctly.
If I run Feature C it doesn't generate the report.
If I run Features A, B and C it doesn't generate the report.

Could it be that Feature C has a Scenario Outline ? (even if it is not being run as it is filtered by @tags)

The funny thing is, it does work with the old report and old version.

And to make it even more interesting, if I take out the adapter report from the runner class and use the old HTML reports, they actually work

	"pretty:Reports/TEST/StdOut/STDOUT"
	,"html:Reports/TEST/HTML"
	,"json:Reports/TESTR/JSON/TEST.json"
	,"usage:Reports/TEST/JSON/TEST-Usage.json"
	,"rerun:Reports/TEST/TEST-ReRun.txt"

@adrian-arg
Copy link
Author

Well, I can confirm that the issue seems to be related to Features containing Scenario Outline / Examples, even If the particular Scenarios are not run.
If the Runner class references a Feature that contains Scenario Outline, then it won't generate a report.
If I take out the "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" it generates all other HTML reports.

@foursyth
Copy link

Hello again @adrian-arg

I do not think Scenario Outline is the culprit. Still, is it possible for you to share one that produces such error which we can use to test? You do not need to provide the Java StepDefs - just the Scenario Outline. We can create dummy step defs and test.

In extentreports-4.0.0, there was an issue with Asterisk (*) which was resolved in 4.0.1. Do any of your steps have the asterisk keyword as shown in the example below?

Scenario:  hello world
    Given something
    * something else

@foursyth
Copy link

Btw, if Asterisk was the issue, you can upgrade to version extentreports-cucumber4-adapter:1.0.2 and it should now be resolved. If it is something else, it would help if you can share an example with us so we can test.

Although Scenario Outline was part of my example too, see here. And it works..

@adrian-arg
Copy link
Author

adrian-arg commented Nov 15, 2018 via email

@foursyth
Copy link

I have also noticed issues with Eclipse IDE for EE (Eclipse IDE for Java EE Developers). The toned down IDE (Eclipse IDE for Java Developers) works fine. I am not sure why that is so, but starting version 2 of Cucumber, my code fails to work properly in the EE version.

@deena-p
Copy link

deena-p commented Nov 16, 2018

Hi @foursyth
I am also facing the same issue: cucumber4 adapter is not generating report (extent.reporter.html).
I am using below versions:
<cucumber.type>io.cucumber</cucumber.type>
<cucumber.version>4.0.1</cucumber.version>
<cucumber.extent.report>1.0.2</cucumber.extent.report>

Here is my code of TestRunner:

@CucumberOptions(
features = "src/test/java/features",
tags = {"@AllTestScenarios"},
plugin = {
"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"
}
)
public class CucumberTestRunnerWD {

private TestNGCucumberRunner testNGCucumberRunner;

@Before
public void beforeSuite() {
    instantiateDriverObject();
}

@After
public void afterSuite() {
    DriverFactory.closeAllDriverObjects();
}


@BeforeClass(alwaysRun = true)
public void setUpClass() {
    testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
}

@Test(groups = "cucumber", description = "Runs Cucumber Scenarios", dataProvider = "scenarios")
public void feature(PickleEventWrapper pickleEvent, CucumberFeatureWrapper cucumberFeature) throws Throwable {
    testNGCucumberRunner.runScenario(pickleEvent.getPickleEvent());

}

@DataProvider
public Object[][] scenarios() {
    return testNGCucumberRunner.provideScenarios();
}

@AfterClass(alwaysRun = true)
public void tearDownClass() {
    testNGCucumberRunner.finish();
}

}

@foursyth
Copy link

Hello @deena-p

Would you be kind enough to send a sample with me that I can share with my team and fix asap?

@deena-p
Copy link

deena-p commented Nov 16, 2018

Hi @foursyth
Here is the sample which I have created from my project.

https://github.com/deena-p/cucumber4-sample-deena

Thank you very much for your quick response.

@adrian-arg
Copy link
Author

adrian-arg commented Nov 16, 2018

Thanks, @foursyth . I think I got it down!

Just to leave everything here in case anyone else runs into the same issue:

I'm running Eclipse IDE for Java Developers.

If I use an * in the Feature file I get a
java.lang.ClassNotFoundException: com.aventstack.extentreports.gherkin.model.*
The report is generated, but the particular Step is not attached.

You were right, there Scenario Outlines weren't the culprits, it just happened to be that all my failing Scenarios had a Scenario Outline.

A few hours ago I finished refactoring all of my Step Definitions so I was no longer able to reproduce the Scenario Outline issue.

So, I started messing around with the order of the Steps to force a few Exceptions and voilà!

If the Exception is thrown in the middle of the Scenario and some Steps are Skipped, then the console doesn't show the Stack-Trace and the Report is not generated.

It's like something is happening between the failing step and the skipped steps.

The feature file looks something like this:

Scenario: Checkout Page
Given an authenticated user <<< Step Fails
When selects a product
Then the checkout page is displayed

Scenario Outline: Checkout Page
Given an authenticated user using "" <<< Step Fails
When selects a product
Then the checkout page is displayed

Examples:
| email |
| [email protected] |
| [email protected] |

__
It's very late so I will check if the new version fixes anything tomorrow, although I see @deena-p is using the latest version.

@foursyth
Copy link

Thank you @adrian-arg and @deena-p. I much appreciate your efforts!

@deena-p
Copy link

deena-p commented Nov 16, 2018

Hi @foursyth
After I copied the extent.properties and .xml file to resources folder. Now it is working.
Reports are generated. Also updated the sample project.
Thank you.

@deena-p
Copy link

deena-p commented Nov 16, 2018

Hi @foursyth
Can you please let know how to attach screenshot to the scenarios when we use the adapter?
Thank you

@foursyth
Copy link

Hello @deena-p

Sure, I will have a look today and let you know.

@foursyth
Copy link

Also, so its working for you now? Wow!

One thing I would like to point out after looking at your project. You must use only 1 type of report from the initalization (enabled the HTML for now, as only HTML and Logger are available in community version):

extent.reporter.avent.start=false 
extent.reporter.bdd.start=false 
extent.reporter.cards.start=false 
extent.reporter.email.start=false 
extent.reporter.html.start=true 
extent.reporter.klov.start=false 
extent.reporter.logger.start=false 
extent.reporter.tabular.start=false 

@anshooarora
Copy link
Member

anshooarora commented Nov 26, 2018

@adrian-arg I just worked on your example with foursyth - this should be fixed. Please try with:

<version>1.0.5-SNAPSHOT</version>

link

The issue was that the scenarioOutline ThreadLocal wasn't being reset after completion.

@anshooarora
Copy link
Member

@deena-p Do you mind opening a new ticket for the 1st item? As foursyth said, this can be added via config (properties or Java, although I prefer properties). Let me know your thoughts as well.

@deena-p
Copy link

deena-p commented Nov 26, 2018

@anshooarora @foursyth
Hi I have created a new ticket for the first item. #2

@reach2jeyan
Copy link

reach2jeyan commented Dec 6, 2018

@foursyth
Can you explain why do I need to use extractBytes when I am able to have the screenshots attached to the extent reports with

TakesScreenshot ts = (TakesScreenshot) Main.driver;
            byte[] screenshot = ts.getScreenshotAs(OutputType.BYTES);
            scenario.embed(screenshot, "image/png");

I never needed to use scenario.embed(extractBytes(name));
screnshotextent

@anshooarora
Copy link
Member

anshooarora commented Dec 6, 2018

Hello @reach2jeyan if your existing method returns a byte array, then you do not need to use the method recommended by @foursyth.

@testdgvn
Copy link

Hi @reach2jeyan can you please show me in detail your embed method? I've tried yours but got no luck seeing the screenshots attached to report (screenshots is just generated to proper folder instead). Where did you implement the method?

I'm using extentreports-cucumber4-adapter: 1.0.7 and extentreports: 4.0.9

Thanks in advance!
cc @anshooarora

@foursyth
Copy link

As shared earlier:

@After
public void after(Scenario scenario) {
    scenario.embed(extractBytes("img.png"), "image/png");
}

@AfterStep
public void afterStep(Scenario scenario) {
    scenario.embed(extractBytes("img.png"), "image/png");
}

@subha077
Copy link

subha077 commented May 8, 2019

Hi, @foursyth , @anshooarora ..
Great work on the adapter 4. I am able to generate detailed report now. But Now I am facing two issues.

(1) Can not add system info to the report - please suggest.
(2) The error screenshots are being generated but not getting attached to the extent report. I tried to embed them using @after method.

Here is the link for the sample project. can you please suggest and advice as soon as possible.

Thanks in advance..
Here is the link for the project code.

@Andyclark97
Copy link

@foursyth @anshooarora I am having same problem as @subha077 above. Screenshots are being generated by not added to the report.

@igorakintev
Copy link

I have the same bug as @subha077 and @Andyclark97

@SamiraKhodami
Copy link

@foursyth @anshooarora I am having same problem as @subha077 above. Screenshots are being generated but not added to the report.
I am using extentreports-cucumber4-adapter , version 1.0.7 with cucumber 4.2.0

@Vinoth0194
Copy link

Hi, Can some One help me out to fix this issue?

io.cucumber.core.exception.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter

I am getting this error
This is my runner class.
Screenshot 2020-06-24 at 12 28 34 PM

and this is my pom.XML


4.0.0
org.yoco.example
YoCoS
1.0-SNAPSHOT

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>6.1.1</version>
    </dependency>



    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>6.1.1</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>6.1.1</version>
    </dependency>


    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-jvm-deps</artifactId>
        <version>1.0.6</version>
        <!--            <scope>provided</scope>-->
    </dependency>

    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>5.3.0</version>
    </dependency>

    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>1.0.2</version>
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>5.7.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.12</version>
        <exclusions>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-java</artifactId>
            </exclusion>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

</dependencies>

@anshooarora
Copy link
Member

@Vinoth0194 This is the version4 adapter, not tested with versions 5+.

@anshooarora
Copy link
Member

@subha077 @Andyclark97 @igorakintev @SamiraKhodami

Please let me know if you are still having this issue.

@Vinoth0194
Copy link

@anshooarora I am not getting it.

@anshooarora
Copy link
Member

You have:

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>6.1.1</version>
    </dependency>

with:

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.12</version>
        <exclusions>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-java</artifactId>
            </exclusion>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Version 4 adapter with Cucumber 6. Not supported.

@Vinoth0194
Copy link

okay. I will change the version and check the reports.

@Vinoth0194
Copy link

I have changed the version: but now i am getting this error

java.lang.NoClassDefFoundError: io/cucumber/core/eventbus/EventBus

at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getConstructor(Class.java:1825)
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:70)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28)
at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19)
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)

Caused by: java.lang.ClassNotFoundException: io.cucumber.core.eventbus.EventBus
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 15 more

Updated POM.xml


4.0.0
org.yoco.example
YoCoS
1.0-SNAPSHOT

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>4.8.1</version>
    </dependency>



    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>6.1.1</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>4.8.1</version>
    </dependency>


    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-jvm-deps</artifactId>
        <version>1.0.6</version>
        <!--            <scope>provided</scope>-->
    </dependency>
    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>1.0.2</version>
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>4.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.12</version>
        <exclusions>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-java</artifactId>
            </exclusion>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

</dependencies>

@Vinoth0194
Copy link

thanks. Its working fine.

@SonaliSihra
Copy link

SonaliSihra commented Jul 11, 2020

@anshooarora Hey, with all the discussion above it is getting confusing. I'm facing the issue where the reports are getting generated but the images are not found in the report... I figured out that the path is set wrong in the report.html file and it is searching for the reports at http://localhost:63342/home/User/locustapitest/target/cucumber-reports/locustcharts/performanceChart1594459662333.png
whereas the image is available on http://localhost:63342/locustapitest/target/cucumber-reports/locustcharts/performanceChart1594459662333.png.
I think I have a problem with cucumber and com.aventstack version in my pom.xml Can you please confirm once which com.aventstack version is suitable for 201.7846.6 (plugin in intellij) , Currently I'm using

com.vimalselvam
cucumber-extentsreport
3.1.1

	<dependency>
		<groupId>com.aventstack</groupId>
		<artifactId>extentreports</artifactId>
		<version>3.1.5</version>
	</dependency>

@anshooarora
Copy link
Member

@SonaliSihra the dependencies you are using seem correct, but I believe these are for version 1 of Cucumber. Is this the version you are using? You can find the correct adapters from this page: https://github.com/extent-framework/extentreports-java/wiki/Plugins

@praveen1626
Copy link

praveen1626 commented Aug 24, 2020

Hi, Can some One help me out to fix this issue?

io.cucumber.core.exception.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter

I am getting this error
This is my runner class.
Screenshot 2020-06-24 at 12 28 34 PM

and this is my pom.XML

4.0.0
org.yoco.example
YoCoS
1.0-SNAPSHOT

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>6.1.1</version>
    </dependency>



    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>6.1.1</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>6.1.1</version>
    </dependency>


    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-jvm-deps</artifactId>
        <version>1.0.6</version>
        <!--            <scope>provided</scope>-->
    </dependency>

    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>5.3.0</version>
    </dependency>

    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>1.0.2</version>
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>5.7.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.12</version>
        <exclusions>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-java</artifactId>
            </exclusion>
            <exclusion>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

</dependencies>

Hi Vinoth,

Even i am facing the exact issue here.. I see you have fixed the issue, can you please help me here to update my POM xml..

Please find the POM.xml of mine

io.cucumber cucumber-java 5.7.0 io.cucumber cucumber-core 5.7.0 io.cucumber cucumber-junit 5.7.0 test io.cucumber cucumber-testng 5.7.0
<!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>3.141.59</version>
</dependency>
<dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>6.14.3</version>
</dependency>
com.aventstack extentreports-cucumber4-adapter 1.0.12 io.cucumber cucumber-java io.cucumber cucumber-core

### Error Message:

io.cucumber.core.exception.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter

at io.cucumber.core.options.PluginOption.loadClass(PluginOption.java:117)
at io.cucumber.core.options.PluginOption.parsePluginName(PluginOption.java:102)
at io.cucumber.core.options.PluginOption.parse(PluginOption.java:86)
at io.cucumber.core.options.RuntimeOptionsBuilder$ParsedPluginData.addPluginName(RuntimeOptionsBuilder.java:238)
at io.cucumber.core.options.RuntimeOptionsBuilder.addPluginName(RuntimeOptionsBuilder.java:62)
at io.cucumber.core.options.CucumberOptionsAnnotationParser.addPlugins(CucumberOptionsAnnotationParser.java:109)
at io.cucumber.core.options.CucumberOptionsAnnotationParser.parse(CucumberOptionsAnnotationParser.java:57)
at io.cucumber.testng.TestNGCucumberRunner.<init>(TestNGCucumberRunner.java:79)
at io.cucumber.testng.AbstractTestNGCucumberTests.setUpClass(AbstractTestNGCucumberTests.java:22)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.NoClassDefFoundError: cucumber/api/event/ConcurrentEventListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at io.cucumber.core.options.PluginOption.loadClass(PluginOption.java:110)
... 22 more
Caused by: java.lang.ClassNotFoundException: cucumber.api.event.ConcurrentEventListener
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

@reshmi537
Copy link

Report is not generating.But no error.Could u help me?

@saravanakumarm1986
Copy link

Above issue, i am also facing. Please give me a possible solution to resolve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests