Getting Initialization Failed error after adding Extent Report plugins
Before adding the extent.properties, extent-config.xml, it was working fine. Please help Error- io.cucumber.core.exception.CucumberException: java.lang.NoClassDefFoundError: io/cucumber/messages/internal/com/google/protobuf/GeneratedMessageV3 at io.cucumber.core.plugin.PluginFactory.newInstance(PluginFactory.java:120) at io.cucumber.core.plugin.PluginFactory.instantiate(PluginFactory.java:99) at io.cucumber.core.plugin.PluginFactory.create(PluginFactory.java:63) at io.cucumber.core.plugin.Plugins.createPlugins(Plugins.java:32) at io.cucumber.core.plugin.Plugins.<init>(Plugins.java:25) at io.cucumber.junit.Cucumber.<init>(Cucumber.java:160) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21) 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:26) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:513) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) Caused by: java.lang.NoClassDefFoundError: io/cucumber/messages/internal/com/google/protobuf/GeneratedMessageV3 at com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter.<init>(ExtentCucumberAdapter.java:87) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at io.cucumber.core.plugin.PluginFactory.newInstance(PluginFactory.java:116) ... 22 more Caused by: java.lang.ClassNotFoundException: io.cucumber.messages.internal.com.google.protobuf.GeneratedMessageV3 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 28 moreSolved18KViews0likes5CommentsHow to share the Spring Boot context between steps in cucumber test?
Hi all, I am working on a cucumber integration test project for spring boot. Currently I have only one feature file, and I have placed @SpringBootTest & @AutoConfigureMockMvcannotations within the stepdef file. I would like to have these annotations common for all step files. Please help me in doing this. I would much appreciate any help. Thanks. @SpringBootTest @AutoConfigureMockMvc12KViews0likes2Commentsrun cucumber selenium tests in gitlab-ci
Hi I have a selenium cucumber project with some tests. The tests worked and the chromeDriver had launch when I run the -mvn clean compile test in my IDE. I created this .gitlab-ci.yml in my project's root: image: markhobson/maven-chrome:jdk-11 stages: - build - test variables: MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" cache: paths: - .m2/repository/ - target/ build: stage: build script: - mvn $MAVEN_OPTS clean package - mvn compile test: stage: test script: - mvn test When I run the pipeline, I face this error in the console: Unable to load browser: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '4.0.0-beta-1', revision: '9c03156c2b' System info: host: 'runner-fa6cab46-project-25183469-concurrent-0', ip: '172.17.0.4', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.78-coreos', java.version: '11.0.10' Driver info: org.openqa.selenium.chrome.ChromeDriver What can I do for running the tests?8.8KViews0likes16Comments-- rerun failed scenarios
I found a lot of articles about rerun the failed tests but none of them satisfies my needs. The closest solution I found is here.But I am not quite sure about this solution. Especially because of order and parallel runs. I would like to rerun failed scenarioimmediately when it fails. So the first question is if it is possible. It sounds like clean straightforward use case but I cant not find any documentation to it. I found also this article which mention --retry flag but the link to documentation returnss error 521. So I would like to know where I could find something about --retry flag. Thanks for any help I am little lost in it for now.Solved7.7KViews0likes4CommentsStrict removed from CucumberOptions
Hello everyone! In Cucumber 7.0.0 the strict in@CucumberOptions is deprecated. So when running a test case I get the error: Unable to parse scenario probably due to unimplemented features. Which clearly shows that I cannot run a test case unless strict is a part of the CucumberOptions. Has anyone stumbled upon this issue and knows a solution for it? Best Regards Lisa MarieSolved7.2KViews0likes5CommentsError when running DataTables in Cucumber 7.0.0
Hello! I have stumbled upon many issues regarding my Cucumber Uplift to version 7.0.0 and I cannot seem to find a solution for this error: Can't convert DataTable to List<Map<class java.lang.String,class java.lang.String>>. You have to write the conversion for it in this method. I cannot add the code here since its confidential but do you know how to solve this issue? The method uses DataTableWrapper and from what I have read the issue should be solved by changing getMaps to getLists but that does not work for me. All kinds of help would be greatly appreciated! Best Regards Lisa MarieSolved5.6KViews0likes1CommentWays to find the total number of scenarios when the test execution starts?
I am working on a custom report formatter for a cucumber test framework. I have 20+ feature files and contains different tags for each files. I am using Cucumber CLI and passing specific tags to execute the tests. Problem: I need to implement a progress report which shows how many scenarios were executed vs how many scenarios are still remaining to be executed. The report will dynamically show the progress in terms % of test completion. I am able to count the total number of scenarios executed as it either passes/ fails using the@Afterhooks. However I am unable to find the total number of scenarios to be executed. I have tried to implement the ConcurrentEvent listenerforTestRunStartedEvent. But it does not provide any summary details. I believe Cucumber Runtime model may be able to provide this information, but could not get it to work. If you have solved similar problem, please post it here. Appreciate any help/ideas to solve this.Solved4.9KViews0likes2CommentsOption cucumber.features does not work in cucumber.properties file
My test class is: import org.junit.runner.RunWith; import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions; @RunWith(Cucumber.class) @CucumberOptions(features = "src/test/java/posters/cucumber/features", glue = "posters.cucumber.support", tags = "@Chrome and not @Skip", monochrome = true) public class SingleFeatureTest { } My cucumber.properties file is: cucumber.publish.quiet=true cucumber.plugin = pretty, summary, html:target/cucumber-report/cucumber.html This works fine. Then I move the "features" and the "glue" option from the test class to the cucumber.properties file: New test class: import org.junit.runner.RunWith; import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions; @RunWith(Cucumber.class) @CucumberOptions(tags = "@Chrome and not @Skip", monochrome = true) public class SingleFeatureTest { } New cucumber.properties file: cucumber.publish.quiet=true cucumber.plugin = pretty, summary, html:target/cucumber-report/cucumber.html cucumber.features = src/test/java/posters/cucumber/features cucumber.glue = posters.cucumber.support It does NOT work. I work with java SE 11 cucumber-junit 6.8.1 cucumber-java 6.8.1 cucumber-picocontainer 6.8.1 allure-cucumber6-jvm 2.13.6 I couldn't find anything in internet documentation that helped me. There are very few examples of the cucumber.properties file. On the other hand, I found the class io.cucumber.core.options.Constants and believe that I have found the possible options in the cucumber.properties. Is that right? Many thanks for your help4.9KViews1like1CommentLooking for help with Serenity Cucumber 7 Maven Java project to run in Parallel
looking for help to execute cucumber 7 in parallel. My project is serenity with cucumber, maven and java. In this linkhttps://johnfergusonsmart.com/parallel-test-execution-with-cucumber-and-serenity-bdd/it is showing that it is possible to run but tried different combination and looks like I missed something. Also, read all posts from Cucumber documentation that were posted here, but looks like missing something. Here is my POM.xml file: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.d</groupId> <artifactId>Automation</artifactId> <version>1.0-SNAPSHOT</version> <properties> <serenity.version>3.2.0</serenity.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <encoding>UTF-8</encoding> <tags></tags> <parallel.tests>4</parallel.tests> <webdriver.base.url></webdriver.base.url> <maven.compiler.source>11</maven.compiler.source> <maven.compiler.target>11</maven.compiler.target> <java.version>11</java.version> </properties> <dependencies> <dependency> <groupId>net.serenity-bdd</groupId> <artifactId>serenity-rest-assured</artifactId> <version>${serenity.version}</version> </dependency> <dependency> <groupId>net.serenity-bdd</groupId> <artifactId>serenity-cucumber</artifactId> <version>${serenity.version}</version> </dependency> <dependency> <groupId>org.junit.platform</groupId> <artifactId>junit-platform-launcher</artifactId> <version>1.8.1</version> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <version>5.8.2</version> </dependency> <dependency> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> <version>5.8.2</version> </dependency> <dependency> <groupId>com.googlecode.lambdaj</groupId> <artifactId>lambdaj</artifactId> <version>2.3.3</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.12.4</version> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> <version>2.1.1</version> </dependency> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>1.4.1</version> </dependency> <dependency> <groupId>commons-dbutils</groupId> <artifactId>commons-dbutils</artifactId> <version>1.7</version> </dependency> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> <version>9.4.0.jre11</version> </dependency> <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> <version>2.6.0</version> </dependency> <dependency> <groupId>com.github.javafaker</groupId> <artifactId>javafaker</artifactId> <version>1.0.2</version> </dependency> <dependency> <groupId>org.awaitility</groupId> <artifactId>awaitility</artifactId> <version>4.1.1</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M5</version> <configuration> <skip>true</skip> </configuration> </plugin> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>3.0.0-M5</version> <configuration> <includes> <include>**/*Runner.java</include> </includes> <systemPropertyVariables> <webdriver.base.url>${webdriver.base.url}</webdriver.base.url> </systemPropertyVariables> <parallel>methods</parallel> <!-- <threadCount>${parallel.tests}</threadCount>--> <!-- <forkCount>${parallel.tests}</forkCount>--> <useUnlimitedThreads>true</useUnlimitedThreads> </configuration> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <source>11</source> <target>11</target> <compilerArgs> <arg>-parameters</arg> </compilerArgs> </configuration> </plugin> <plugin> <groupId>net.serenity-bdd.maven.plugins</groupId> <artifactId>serenity-maven-plugin</artifactId> <version>${serenity.version}</version> <configuration> <tags>${tags}</tags> <reports>single-page-html</reports> </configuration> <executions> <execution> <id>serenity-reports</id> <phase>post-integration-test</phase> <goals> <goal>aggregate</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>net.serenity-bdd</groupId> <artifactId>serenity-single-page-report</artifactId> <version>${serenity.version}</version> </dependency> </dependencies> </plugin> </plugins> </build> </project> Here is the struckture of my project in general: src - main - java - actiona - pages - test - java - runner - steps - resources - features Execution: I add to multiple feature files the same tag and execute through command line mvn clean verify -Dtags="@regression" Issue: Only opens one browser at a time, not like in parallel some browsers at one time.Solved4.4KViews0likes1Comment