Questions tagged [cucumber-java]

Cucumber-JVM is a pure Java implementation of Cucumber that supports the most popular programming languages for the JVM. Cucumber-JVM supports the following JVM languages: - Java - Groovy - Scala - Clojure - Jython - JRuby - Rhino JavaScript - Gosu

Cucumber is basically Ruby based. But Java can be used by using Cucumber JVM.

Running You can run it with the tool of your choice. There are several ways to run scenarios with Cucumber-JVM:

  • JUnit Runner
  • CLI Runner
  • Android Runner
  • Third party runners

Cucumber-JVM also integrates with all the popular Dependency Injection containers. For details Dependency Injection

1140 questions
3
votes
0 answers

How to handle depended scenarios in cucumber 4 parallel execution with TestNG

As per cucumber 4 with TestNG: When using TestNG in parallel mode, scenarios can be executed in separate threads irrespective of which feature file it belongs too. Different rows in a scenario outline can be also executed in separate threads. The…
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
3
votes
0 answers

java.lang.NoClassDefFoundError: io/cucumber/plugin/event/EventPublisher

I'm trying to run my script, but, I'm getting this error: java.lang.NoClassDefFoundError: io/cucumber/plugin/event/EventPublisher at java.base/java.lang.ClassLoader.defineClass1(Native Method) at…
AbirHG
  • 31
  • 1
  • 3
3
votes
3 answers

How can gets all tags and cucumber scenarios without run tests

I would like somehow get list of all tags which I used in my project and get all names of cucumber scenarios which I have in my project without run tests. Could someone helps me how can I do this?
Jess
  • 31
  • 1
  • 2
3
votes
1 answer

Implementation of shared state among cucumber steps in java

I have two-page objects called OrderSelection and OrderDetails. In addition, I have SharedState class and OrderSelectionStepDef and OrderDetailsStepDef. I declared two variables for OrderSelection and OrderDetails in SharedState. However, they are…
Vinee-the-Pooh
  • 835
  • 3
  • 10
  • 27
3
votes
2 answers

Can I use Cucumber with Selenium Grid to run the scripts on different node at the same time?

I have searched for same but faced with failure. Is there any other tool which can be utilised effectively to run the scripts on multiple node?
3
votes
1 answer

How to handle Cucumber AmbiguousStepDefinitions Exception?

Currently I'm running a series of tests which use the following steps: @And("^I select (.*) as a subject type$") public void click_on_subject_type(String subject) { String subjectType = String.format("//*[text()='%s']", subject); …
SamP
  • 417
  • 5
  • 24
3
votes
2 answers

cucumber-testng 4.0 parallel execution defaults to 10 always

Here is my cuke runner. I am trying to use inbuilt parallelism built in cucumber-jvm 4.0.0 by overriding dataprovider method. I see that my scenarios are invoked in parallel however the thread count defaults to 10 always. I tried executing with…
Bhuvanesh Mani
  • 1,394
  • 14
  • 23
3
votes
1 answer

How to stop Cucumber runner from printing the details in the console

How to stop Cucumber runner from printing the details in the console ? String [] argv = new String[]{ "-g" ,"components" ,"./Features" //,"-t","@functional,@regression" ,"-n","Validate_login_search_using_sku_id" }; ClassLoader…
novice
  • 43
  • 11
3
votes
2 answers

Reusable/Generic Examples table in Cucumber

Is it possible for multiple scenarios to use the same Examples table? So instead of having something like the following: Scenario Outline: First Scenario Given I am viewing "" Then I assert that the current URL "" Examples: …
Andrea
  • 55
  • 1
  • 5
3
votes
1 answer

How to ignore stepdefinition variable declaration in cucumber for same value

How to ignore stepdefination variable declaration in cucmber for same value? So suppose I have example as below: Scenario Outline: Looking up the definition of fruits Given the user is on the Wikionary home page When the user looks up…
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
3
votes
1 answer

How to map gherkin step definition data to a Java object in Cucumber?

I have following three classes: class City { String name; String code; } class Address { String street; City city; } class Person { String name; int age; Address address; } Now, I have a REST API to POST a person. POST /person { …
3
votes
2 answers

how to execute Cucumber Step defination with TestNG annotation

I am supposed to migrate on Cucumber. I do have project framework with Selenium, TestNG with Data Driven Framework, Maven. I am exploring Cucumber feasibility with TestNG annotation. My question is, How we can create connection between @Test method…
Ishita Shah
  • 3,955
  • 2
  • 27
  • 51
3
votes
1 answer

Step Definition not found with io.Cucumber (java8 - testng - spring)

I upgraded the cucumber version I was using to run each cucumber scenario in a different @Test but now my runner can't find my step definition My tests were running fine when I was using cucumber 1.2.5 with the groupId Info.cukes but know that I…
3
votes
3 answers

Cucumber tests - break example table of scenario outline into smaller chunks

I have a big example table in scenario outline with around 20 columns Scenario Outline: .... Given .... When ... Then .... Examples: |col1|col2|col3|col4|col5|........|col20| |val1|val2|val3|val4|val5|........|val20| Is it…
3
votes
2 answers

Migrating from info.cukes to io.cucumber shows no steps status when running the test

My tests run fine with the following in the pom.xml: info.cukes cucumber-java 1.2.5 info.cukes
nu75h311
  • 33
  • 5