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
0
votes
1answer
32 views

Why is my Feature File failing to find the Step Definition?

I have the following Feature File which is grayed out so I cannot run it from an IntelliJ Run configuration, nor from the right click context in the Feature File, though it runs fine from the Run.java ...
0
votes
1answer
10 views

Specflow Cucumber BDD - Only log in once on test run not on every scenario

We have a Cucumber BDD test project using C# Specflow. The application is browser based tested using Selenium WebDriver automation framework. There are a number of feature files with scenarios: ...
0
votes
1answer
25 views

Cucumber- Selenium Getting null pointer exception while openBrowser method

I am getting null pointer exception when selenium tries to launch the browser. I have already checked step Definition. Selenium OpenBrowser Method. Chrome browser version. ( I have driver 87.04 ...
0
votes
2answers
418 views

How to fix cucumber step does not have matching glue code?

The cucumber feature file has all steps highlighted in yellow and warning is shown as step does not have matching glue code, When I try to run the project as maven test, I am getting null pointer ...
0
votes
1answer
41 views

Cucumber + Junit + Extend Test Steps (use IDs in next step)

Details: We currently use Mockito/ Wiremock (in different teams), Junit and Cucumber in our test procedure. And test cases are functional, but we want to extend them with regard to post procedures. ...
0
votes
1answer
122 views

how to read the following data from excel using cucumber-java

Heading How to get the username and password from excel using cucumber package com.qa.excel; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.poi.ss....
0
votes
1answer
80 views

I'm using ExtentSparkReporter for generating extent reports in cucumber with testng …how to add screenshot for failure scenarios

package cucumberhooks; import java.util.HashMap; import java.util.Map; import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack....
-1
votes
1answer
49 views

Cucumber with junit to automate java swing app

I need to automate java swing desktop application and want to run functional scenarios including click on buttons, opening of drop down lists etc using cucumber. Is there any junit package/class that ...
0
votes
1answer
26 views

Graphical front-end for jmeter

I use jmeter to test REST web services. For some customers, I'd like a graphical interface to show the flow of a script. I imagine tiles for each web service call and lines connecting those tiles to ...
2
votes
1answer
174 views

Hardening of test cases in test automation

Details: In a discussion about maintainability of automatic test cases in the area Cucumber + Junit / Unitest the topic "hardening of test cases" came up. You know this topic from your ...
1
vote
0answers
34 views

Is each Scenario in Cucumber BDD framework considered a separate .Java Class by JVM?

When I write Cucumber scenario's like:- User.java Feature File Scenario: Add a new user profile Given User is on the Add user profile page When user enters profile information and clicks ...
0
votes
0answers
33 views

How to execute test cases after ide crashed

Kindly suggest if I have 100 test cases after executing 40 Test Cases my IDE was crashed. So, on the next time when I am restarting my Test Cases again the execution should be start from 41 to 100. I ...
0
votes
0answers
10 views

Executing cucumber feature file in eclipse

I have installed cucumber plugin on eclipse 2019-09 but the console doesn't show anything after I run the feature file. I have created Maven project in eclipse and created one package for testrunner ...
1
vote
4answers
223 views

How to initialise the PageObject Class using PageFactory only ONCE in a Step Definition Class in a Selenium Webdriver + Cucumber project?

I am making a Regression suite Automation project using Selenium Webdriver, Java, Cucumber, Maven etc. Now, the problem is that I have multiple Page Object classes that I initialise again and again ...
0
votes
1answer
32 views

Is it considered an anti-pattern for me to group Cypress test steps this way?

Writing end2end tests with Cypress and cucumber, on a high level the test cases are as following: Feature: Users can change color scheme @focus Scenario: The user changes color scheme from Black ...
0
votes
1answer
129 views

How to get WebDriver Instance(Object) from Hooks(@Before) for parallel executions of scenarios

I want to get WebDriver Instance(Object) from the Hooks Class in @Before Annotation setup() method. And I want to do it in such a way that I am able to run my scenarios in parallel. I know what are ...
0
votes
1answer
82 views

Can Robot Framework framework iterate over example data?

The BDD sample below is written using Katalon Studio Scenario Outline: Verify Price of <plan> Plan Given <accountType> account is currently logged in When User navigates to Publish ...
0
votes
2answers
41 views

In Gherkin files, should I repeat the steps in the previous scenario if my following scenario depends on it?

I have read about the Cardinal Rule of BDD from various places when writing Gherkin files. In many of these examples, they have the following scenarios in a feature file: Feature: Google Searching ...
1
vote
1answer
55 views

Hooks not getting executed in protractor cucumber

I new to protractor, and trying to implement hooks. But the hooks are not getting executed. Following is my code: Hook.js: const { Before } = require('cucumber'); const {AfterAll} = require('...
0
votes
1answer
29 views

Getting undefined when I define {string} parameter in the when section in the step definition in protractor cucumber

I am new to protractor with cucumber. I have to automate a flow wherein on entering first name, last name, and postcode, a new user is created. I am trying to add the data to be entered in the feature ...
0
votes
0answers
19 views

How to add the number of times a test needs to be run in webdriverio and javascript

I would like to repeat a test run multiple times. So I would like to add the count to the command we are passing to run the test. I tried adding the option to grunt file but is not working Command ...
0
votes
0answers
143 views

How can i run my Cucumber project as a Maven Test as the Build passed but it shows Tests run: 0?

I have created a Cucumber project, which has multiple feature files, Step definition classes and one TestRunner.java class. Now, that project has a Maven project structure and i want to run it as a "...
1
vote
1answer
301 views

WARNING: Passing multiple tags through @CucumberOptions is deprecated. Please use a single tag expressions?

I tried to run a Cucumber test with multiple tags. But got this error. I am using Cucumber version 5.7.0. How can i run multiple tags now? import org.junit.runner.RunWith; import io.cucumber....
0
votes
0answers
105 views

How can we use the “TableTransfomer” Method to read data from “DataTable” in Cucumber?

I am stuck with using a TableTransfomer Class to convert Datatable into desired domain object. I am following some examples from the web, but have completely messed up my code. I just want Cucumber ...
3
votes
2answers
165 views

Is it good practice to skip the When clause in Gherkin/Cucumber/SpecFlow?

Is it a good practice to skip the When clause in Gherkin/Cucumber/SpecFlow? For instance: Scenario: user has to open a website Given User has access to website Then User should be able to validate ...
1
vote
1answer
290 views

How to implement Extent report in Cucumber using EventListener and Where to find documentation for this class

I was trying to implement a custom formatter using cucumber event listener but I was not able to get official documentation for this class. When I Googled i got the below link : https://www....
0
votes
1answer
35 views

Selenium, Cucumber. How to optimize the code for different objects and same actions?

I am very beginner with Selenium and I'd like to get an advice how to optimize the code. I have 3 tooltips on the website and want to do the same actions for all of them. I have written so far: ...
2
votes
1answer
40 views

Cucumber background feature

I'm trying to understand how to use the background feature in cucumber. My current understanding is that it's used as something that happens before every Scenario. But I don't really understand it. ...
6
votes
3answers
524 views

Is the Page Object Pattern the ideal approach for browser automation for a website which has a front-end that has frames in frames?

I'm confronted with a web application which has a front-end that has frames in frames in frames. Regarding automated UI Tests with Selenium and Cucumber, is the Page Object Pattern the right approach ...
1
vote
1answer
252 views

Guidelines on how to use Cucumber Java Scenario interface

I'm looking for information/guidelines on how to use io.cucumber.core.api.Scenario interface? I read through the API reference documentation and Official Cucumber-Java documentation and some scattered ...
0
votes
0answers
150 views

How can I set the file name of the cucumber reports using net.masterthought plugin?

I'm having issues setting up the file names from the masterthought plugin. https://github.com/damianszczepanik/cucumber-reporting TecStack from the project. java, junit, cucucumber, maven. For ...
3
votes
0answers
454 views

Cucumber - How to run background only once

Using Cucumber with Javascript and Selenium I have the following Gherking file: Feature: Login Background: Given database is filled with these emails and passwords. | tobias@...
1
vote
3answers
77 views

Cucumber feature file name is Jira ticket number

I am starting to name my cucumber .feature files as VerifyLogin_JIRA-1211.feature Is this the correct/optimum naming convention? This question might get closed due to "opinion-based" but there is ...
0
votes
0answers
23 views

read otp from seetest mobile application and paste to continue with login process in web application

I am using cucumber and configure appium and seetest to run web application on mobile browser, i want to check otp that is sent via my application to mobile number (on seetest device number which is i ...
3
votes
2answers
1k views

How to send API request json body in cucumber

Can anyone help me to send json request in one line ?? Example { "benefitPlanIDs": [ { "benefitPlanID": "011748abc", "benefitPlanPlatform": "abc" } ], "clientId": "abc", "...
2
votes
1answer
777 views

How to access step definition variables using hooks.js

Hi in the below protractor-cucumber step-definition, I can modify the step definition variable a from before hook: "use strict"; let { Given, Before } = require('cucumber'); ...
3
votes
1answer
458 views

How to resolve NullPointerException error while implementing POM with cucumber framework

I am getting java.lang.NullPointerException while executing my test case, I am using Page Object Modle with cucumber framework in my maven project, following are the code snippets BoxJunitScript.java ...
4
votes
2answers
3k views

Code coverage for Selenium Tests

Is there any tool available to determine the code coverage for my selenium tests? My tests are written in Java having use of selenium WebDriver with BDD-Cucumber implementation in it.
2
votes
1answer
27 views

Ignoring some test steps depending on variables

I'm using Cucumber + Java + Selenium to UI test an application. I'm using the same set of tests whether my application is deployed in qualification (for tests) or in production. However, when I'm ...
2
votes
2answers
302 views

Check that an element does not exist *after* a button is clicked

With ruby, I'm doing some cucumber tests with capybara to test a Shiny application (shiny is a R package to do web applications). But I'm a newbie with ruby and cucumber (and this is my first post ...
1
vote
1answer
36 views

Cucumber-jvm - Retrieving embedded image from TestCaseFinished event

I have a cucumber plugin where I post my test case results to TestRail using the TestCaseFinished event. It works so far, but on failed steps, I use the scenario.embed method to add a screenshot of ...
5
votes
2answers
374 views

Actual Steps in Step Definition or Call Test Cases in Step Definition, What's the Best Practice?

I'm currently working on a Cucumber project using Katalon Studio, and I'm not sure if... I need to directly write the test items on Step Definition file OR Should I call the test cases in Step ...
1
vote
1answer
88 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
5answers
225 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 ...
1
vote
2answers
53 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 ...
3
votes
2answers
7k 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 ...
-1
votes
1answer
85 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
426 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....
0
votes
1answer
145 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 ...
2
votes
2answers
8k 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 "...