Questions tagged [cucumber]

Cucumber is a tool for running automated acceptance tests written in a BDD (behaviour-driven development) style.

Filter by
Sorted by
Tagged with
1
vote
5answers
49 views

Any advantage to using particular language from Cucumber? BDD enquiry?

I'm curious, I'm only just beginning a journey into the BDD and wondering if there any advantages to the languages which Cucumber (Gherkin) can translate to? I note that some languages are not ...
0
votes
0answers
16 views

Selenium driver throws session has already finished error when using driver.getCurrentUrl()

I'm using cucumber with selenium driver to run automation testing using sauce labs. I noted that it is throwing below error whenever it try to use driver.getCurrentUrl() methods in some cases. I also ...
1
vote
6answers
112 views

How can we manage cucumber background information when require hard set data aliases?

Consider a bunch of scenarios grouped into one feature file that all require setting up a valid user, however I do not want to generate such a user dynamically, for example: Background: Creating a ...
1
vote
2answers
233 views

Cucumber sending string list as parameter

I am using cucumber 4.3.0 and I would like to send an ArrayList of String in one of my sentences. It would give something like that: Given I am on page <page> When I do stuff Then keywords "...
1
vote
2answers
261 views

IntelliJ feature file undefined step reference with import io.cucumber.java.en.Given

I have a feature file with the following: Scenario: Test something Given I do something to test something My step definition: import io.cucumber.java.en.Given; ... @Given("I do something to ...
0
votes
1answer
41 views

Number of actors in E2E tests

We have roughly 30 Cucumber tests and a few actors that run these tests that have been created based on our service's personas. Exemplifying this: We have a C2C ecommerce platform and an user. Users ...
1
vote
1answer
83 views

Why Cucumber repeats Java/Selenium exception text?

For example, tried to locale a web page element by ID and it was not there - why Cucumber repeats the Java output (in addition to - expected - its own scenario/feature/steps failure text) and can I ...
3
votes
1answer
501 views

Unable to launch Safari on iOS using Appium

I am automating some tests a real device (iOS) using Appium and Cucumber. My idea it to do the following steps: Open the app Do some tasks Launch Safari Navigate to a website, lets say google.com ...
0
votes
1answer
85 views

How to Embed / Attach screenshots when each step is executed in Cucumber

I need to take screenshots after each Steps execution and embed them in the results.i have tried in using the "After" method but its capture only the last screen and displaying in the end of the ...
0
votes
2answers
39 views

Cucumber sentence autocomplete

I have a difficulty with writing Cucumber tests. The re-usability of the Cucumber sentences is not consistent - I would like to avoid code duplication when creating sentences and methods glued to the ...
0
votes
1answer
52 views

How to keep a single browser window open during multiple search for a website in the code?

I want to search for different items in a website multiple times and add the item to cart after each search and proceed to checkout after last search. Cucumber opens the new browser for every row in ...
1
vote
1answer
350 views

CLEAR Method skipped while running the tests

I'm writing automation script for a page in which there is a text box. The scenario is as follows: I click on the text box and enter value which will throw error I clear the text box and add valid ...
0
votes
3answers
3k views

How can I pass parameter in xpath?

I am using Java, Selenium Webdriver and Cucumber for my automation.In my feature file I have below statement : And add a room '<x>' The XML code for selecting rooms is shown in below image : ...
2
votes
1answer
5k views

Selenium - How identify disabled field

I want to get the data from disabled field. Here is the HTML: This field is a drop down and i want to identify selected data from the that field. for e.g. field name is Exchange and selected data is "...
3
votes
5answers
710 views

Cucumber : Is it necessary to create multiple step defination class for single feature with multiple scenarios?

I have created one feature file which has 4 scenarios. Do I need to create 4 step definitions or only 1? If 1 then is it ok to have multiple @Given, @When and @Then in one step definition?
-1
votes
1answer
33 views

Unit Testing and Integration Testing with Robot and Cucumber

I understand that both frameworks are great for acceptance testing but how hard or more complex is writing lower level tests such as integration tests or unit tests using the mentioned frameworks when ...
-1
votes
1answer
46 views

Getting Null pointer exception

I am new to Cucumber and I am trying a basic cucumber test. I am getting the below error while running the test. java.lang.NullPointerException at stepDefinitions.Test_steps....
1
vote
1answer
66 views

How do I store a value in a global variable and then use it in subsequent steps of a scenario in protractor cucumber typescript based project

I want to retrieve a value in 'Given' function and then store it in a global variable so that the value is accessible in subsequent steps of a scenario in protractor cucumber typescript based ...
-1
votes
1answer
43 views

Cucumber with and without Rest - Assured. What are the advantages?

Currently my team uses Cucumber as a testing framework. We need to start testing REST web services. I understood that REST-Assured is one of the leading tools for that. Can these tools be used in ...
0
votes
2answers
385 views

Unable to read the parameter value inside a class using TestNG

To achieve parallel execution, I am updating my existing Junit project to TestNG. The requirement here is to run one scenario in different browsers using TestNG RunnerClass is as follows: import ...
0
votes
1answer
44 views

Using a small number of available user properties across a large number of threads

I'm currently building a testing framework for functional tests. I can run them in parallel using Cucumber but I have run into a problem in creating users for each thread (each test requires a brand ...
0
votes
1answer
52 views

Can cucumber tag a single step?

The application that I'm testing receives input from an outside sensor, but sensor data is unavailable on the test environment. Therefore, I use mock data. The problem is, mock data requires some more ...
1
vote
1answer
151 views

I Wanted to know if we can use Katalon for Cucumber BDD frame work but, with Java and not Groovy scripts?

We are using Katalon, but I always wanted to use Cucumber BDD framework. I have he seen that Katalon 5.7 started incorporating Cucumber BDD framework. But, I am not sure how to use it for Java as ...
1
vote
1answer
105 views

Display scenario/test names in Browserstack

I've got a set of cucumber tests I'm running using ruby/capybara. I have the tests outputting to Browserstack but it only outputs the session ID which isn't of much use to me and want to replace with ...
3
votes
3answers
485 views

Where to state test data in Cucumber

I'm struggling to understand the best place to place test data in Cucumber scenarios. My scenario reads like the following: Scenario: Register member for first time Given I have navigated to new ...
0
votes
0answers
174 views

getting null pointer exception for different step definition files with cucumber and selenium

Browser utility: package com.gmsr.utility; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class BrowserUtility { ...
1
vote
3answers
283 views

Use Gherkin syntax for Acceptance Criteria without accompanying BDD tool

Pretty straightforward question: Does anyone have experience writing or consuming Acceptance Criteria written with Gherkin, but doesn't use a BDD tool like Cucumber, Specflow, etc.? Is this method of ...
0
votes
0answers
453 views

Cucumber and TestNG, how to pass parameter?

Could you please tell, how to pass parameter in Cucumber using TestNG? I have following code, but it does not work. Error in stepDefinition.java on the line @Parameters({"environment"}) testng.xml &...
1
vote
2answers
130 views

Using same table for When and Then in gherkin scenario

I have a scenario where I need to insert some data in the system and after that, I check if that data was inserted correctly. Something like: Given the user in the insertion screen When he inserts ...
1
vote
0answers
453 views

Cucumber Report [closed]

I am not able to generate either a Cucumber report or a pretty html report. Runner Class: @CucumberOptions( features = "src/test/resources/Features", glue= {"stepDefinitions"}, ...
1
vote
1answer
45 views

Possibilities on integrating existing cucumber framework with appium

I have an existing automated suite for web browser based application on cucumber framework using selenium and java. We are now planning to run the same test scripts for the mobile app of same ...
0
votes
2answers
62 views

Behavioural Gherkin Steps requiring complex Step Definitions when Automating

I'm currently part of a team that is trying to reinforce BDD in our tests and automation. Our tests up to this point were procedural and we want to move towards behavioural steps. An example of our ...
0
votes
10answers
21k views

cucumber java.lang.IllegalArgumentException: Not a file or directory:

I'm new to cucumber. I have created a cucumber project but cannot seem to run the project. Every time I do, I get an error: java.lang.IllegalArgumentException: Not a file or directory: Here is how my ...
1
vote
3answers
13k views

Cucumber and TestNG integration

I have a simple question as I am just getting into Test Automation. I want to develop Cucumber smoke tests and acceptance tests as they would be easy to read and understand for my colleagues. ...
1
vote
0answers
46 views

Is it possible to write good Code (create a good code framework) AND use Cucumber (or another Gherkin tool)?

When I look at the code Cucumber outputs, it does not seem to follow best practices (or any moderately good practices) for writing a testing framework. Question: Is there a way to use Cucumber and ...
1
vote
1answer
117 views

Cucumber Protractor tests is returning 0 scenarios

I was trying to run a sample test in cucumber protractor javascript tests. But it is returning 0 scenarios.Could someone please look into my code pasted below. sample_scenario.feature Feature: To ...
2
votes
1answer
163 views

Selenium exception is reported twice in logs

I am using Cucumber Page Object model to execute my tests. Here is my POM file:- <dependencies> <dependency> <groupId>info.cukes</groupId> <artifactId&...
2
votes
1answer
3k views

driver.quit() and driver.close() methods are not working inside @AfterTest method

I'm using Selenium using both Java and Cucumber. And I'm curious when I'm using driver.quit() or driver.close() under @AfterTest method, browser won't closed and when I'm using it inside my test step ...
1
vote
2answers
249 views

'to.include' is not working where 'to.eventually.equal' is working

I was trying to check whether a string is present in another string. I am using the below code: expect(actualTimeZone).to.include(employee.timeZone); But it is giving the below error: ...
2
votes
1answer
218 views

How to pass the same webdriver instance between Cucumber tests?

I have a series of steps in a Cucumber-automated test for a web-site. In some cases, I need to pass the Selenium webdriver instance, such that the test can use it to wait until certain elements on the ...
0
votes
1answer
40 views

How do I write a gherkin specification to check a large list of values?

I'm working to write a specification with gherkin (for the first time) for a REST API which will return a long list of paged items (1000 items per page). I'm curious if there's a good way in gherkin ...
0
votes
1answer
309 views

Selenium is not performing Click Action on the Radio Button

Issue: I am trying to perform a click on a radio Button but it is not working it just bypass the step and perform the next step doesn't even give me any error message *Intention is to click on refund ...
0
votes
1answer
830 views

How can I create a dynamic feature file in Cucumber?

I have knowledge about static feature file and it is tough to handle for test case. I want to create dynamic feature file or dynamic content for test case in feature file.
1
vote
2answers
6k views

Cucumber step definitions in .feature file not highlight

In my project, I create simple feature file in my maven project using cucumber syntax. but IntelliJ IDEA, not highlight steps in feature file and also I cant use ALT+ENTER key to create step ...
7
votes
4answers
1k views

Cucumber + Protractor : What will be good practices to maintain test data in separate file?

I am looking to see if this is possible... I am writing UI tests for web and mobile in Cucumber (using Protractor for web and Appium for mobile) and would like to store login details (email and ...
2
votes
3answers
7k views

Running a Cucumber scenario multiple times as long as a new Test Data set is present in excel

I have a scenario where i need to execute a scenario in a feature file multiple times as long as the Test Data is present in the Excel. Each row of the Excel has a different set of test data. I want ...
0
votes
1answer
65 views

How to enter text into a text field nested in an iFrame?

I am using Ruby with Cucumber and attempting to build up a suite of automated tests against a dynamics 2013 system. We have a cart that is a nested into an iFrame and we are attempting to enter a ...
5
votes
4answers
2k views

What is the difference between Given, When and Then annotations in Cucumber?

I do know that basically all Given, When, Then and And keywords in feature definition technically are not distinguished by Cucumber. But why does Cucumber have different annotations for the step ...
4
votes
2answers
12k views

Correct Strategy for Element to be not present in DOM

I have scratching my heads around this problem for two days. I have a test where I need to check if a spinner is not visible to the user. This is the first test of a series of tests, and until the ...
0
votes
2answers
55 views

Cucumber > Saving State up to a Step

I am using Cucumber through IntelliJ and am working on fixing a broken test. I was wondering when debugging, is there a way to save the state of the system up to a certain step in the feature file, if ...