7
votes
Accepted
@And annotation in Cucumber
From The Cucumber Book:
Cucumber doesn’t actually care which of these keywords you use; the choice
is simply there to help you create the most readable scenario.
Some people find Given, When, Then, ...
6
votes
Accepted
Maintenance of cucumber features by non-technical people
Is it too much to ask the non-technical staff to get familiar with the basics of your repo management tools? This would have a few benefits:
They could keep things simple by using branch, checkout, ...
6
votes
What is the difference between Given, When and Then annotations in Cucumber?
The problem Cucumber addresses is communication not architecture.
These keywords are just syntactical sugar, for the business user's understanding and readability. Technically there is no difference.
...
6
votes
Accepted
Cucumber sending string list as parameter
The only way to get a List from the Gherkin input is to use datatables.
To use this approach in your example you would have to re-implement the Then step, like this:
...
Then following keywords are ...
6
votes
Accepted
Is the Page Object Pattern the ideal approach for browser automation for a website with a frontend that has nested frames?
Yes, Page Objects seem the right direction to encapsulate the frame in frames details from the test.
Page objects are a classic example of encapsulation - they hide the
details of the UI ...
5
votes
driver.quit() and driver.close() methods are not working inside @AfterTest method
@BeforeTest, @AfterTest annotations are not supported since Cucumber doesn't has the concept of test. It has features and you are executing the steps in Given, When & And, Then format. So in your ...
5
votes
Is the Page Object Pattern the ideal approach for browser automation for a website with a frontend that has nested frames?
The first rule of test automation is that there are no hard rules but just recommendations, so don't take the page object model "literally". The concept of page object was there long before the pages ...
4
votes
Accepted
BDD Acceptance Tests feel....short?
This looks fine. BDD feature files is meant to be at a level to give useful information to product folks.
In each step you can call lower level steps if you want to give more specific information (...
4
votes
The Usage of "Given" in Cucumber?
Given is a precondition.
When is a user action.
Then is testable outcome.
So when we keep this in mind you should choose your second option:
Given I have an account for the site (precondition).
...
4
votes
What is the purpose of splitting a cucumber Step Definition file
Same reason why you would split large modules in your regular code base: maintainability & navigability.
Over time as your step definitions grow you will have steps that are closely related to ...
4
votes
Accepted
Correct Strategy for Element to be not present in DOM
After a long hard fought battle, I was able to overcome this using opposite of what K-8 had suggested.
Instead of checking if an element is visible on the viewport, I checked the negative of that, ...
4
votes
What are the pros & cons of BDD testing?
I think the pros of BDD are captured in a very good way by a user djojo in his answer - in this SO post - all credits to him
I totally agree the communication is one of the biggest advantage however ...
4
votes
What are the pros & cons of BDD testing?
In theory BDD sounds great. In practice, product owners and developers rarely continue to use BDD past the initial 3-6 months. At pretty much every company I have worked at, BDD inevitably became an ...
4
votes
Accepted
What is the difference between Given, When and Then annotations in Cucumber?
It seems that your question was misunderstood several times and not even your comments fixed this situation. I think at least I got your question right - at least I find it quite clear: It's not about ...
4
votes
Actual Steps in Step Definition or Call Test Cases in Step Definition, What's the Best Practice?
I personally divide the logic into three levels:
feature file (Cucumber),
step definition (Cucumber + Java),
page objects (Selenium and Java).
Cucumber separates business logic from the ...
4
votes
Actual Steps in Step Definition or Call Test Cases in Step Definition, What's the Best Practice?
Katalon has an example project on github: https://github.com/katalon-studio-samples/katalon-bdd-cucumber-tests
Although I find the directory structure hard to navigate the feature example does follow ...
4
votes
How to send API request json body in cucumber
Hi you can use multiline argument (docstring) for this:
https://cucumber.io/docs/gherkin/reference/#doc-strings
https://github.com/intuit/karate/blob/master/README.md#multi-line-expressions
Your ...
4
votes
Is it good practice to skip the When clause in Gherkin/Cucumber/SpecFlow?
It depends
The point of the Given/When/Then pattern is that it describes test preconditions (Given), actions (When), and expected results (Then) - very similar to the unit test arrange/act/assert ...
4
votes
WARNING: Passing multiple tags through @CucumberOptions is deprecated. Please use a single tag expressions?
In Cucumber 5.7.0 the support of tags is handled in different way so that expression(infix boolean expression) can also be used in the same way.
You can pass the multiple tags like
@CucumberOptions(...
3
votes
Accepted
The Usage of "Given" in Cucumber?
As it is described in "The Cucumber For Java Book":
We use Given to set up the context where the scenario happens, When to
interact with the system somehow, and Then to check that the outcome
...
3
votes
Accepted
Importance of cucumber BDD tool
The importance of any Behavior-driven development framework, methodology or tool is to communicate. Cucumber is primarily a tool to communicate requirements between the business people and the ...
3
votes
Accepted
Who provided BDD scenarios to be automated?
This depends who you let write them. It is not like there is a rule whom should write them.
At least the "Feature:" part of the BDD should be written by a business person as user-story format is from ...
3
votes
What experience do you have with the idea "QA designs, Developer develops"
QA certainly does not design anything but some tests.
Design of a feature is responsibility of people who have substantially deeper knowledge about the inner workings of the system, like system ...
3
votes
Running a Cucumber scenario multiple times as long as a new Test Data set is present in excel
Cucumber has Scenario Outline with Examples to 'loop' over the same Scenario with different test cases. You can use it like this:
Scenario Outline: eating
Given there are cucumbers
When I eat ...
3
votes
How can I reset my test data when a UI-test fails with Cucumber-JVM
You can achieve it using cucumber-jvm hooks. If a hook receives a Scenario as a parameter, you can know if it has failed or not.
Example:
@After
public void afterFailedScenario(Scenario scenario) {
...
3
votes
CucumberTests java.lang.IllegalArgumentException: Not a file or directory
Try adding only Feature folder name in "features" instead of the full folder path.
EX:
@RunWith(Cucumber.class)
@CucumberOptions(
format = {"pretty", "html:target/Destination"},
...
3
votes
Can we use java to design specflows?
Use cucumber. Specflow is a part of cucumber family that is developed for .Net world. So if you do not need .Net but need Java, just use the solution that was originally intended for Java
3
votes
How to reuse existing browser session, instead of opening new windows?
You need to rework your utils.getDriver to make it producing a Singleton. You also should not invoke quit() method since it "destroys" the webdriver.
3
votes
Using same table for When and Then in gherkin scenario
You can use Scenario Outlines.
Scenario Outline: Insert and Verify data blah blah
Given I insert <code>, <name> and <Price> into database
Then I can verify that <code>,<...
3
votes
Unit Testing and Integration Testing with Robot and Cucumber
DL;DR: It's possible, but you shouldn't.
All the tools you've mentioned are essentially test runners, meaning they execute a DSL focused on test code in someway.
JUnit and GoogleTest execute methods ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cucumber × 238selenium-webdriver × 94
automated-testing × 86
java × 81
bdd × 44
test-automation-framework × 18
gherkin × 17
testng × 16
junit × 15
ruby × 14
protractor × 13
maven × 13
javascript × 12
appium × 8
page-objects × 7
specflow × 7
cypress × 6
browser-automation × 5
pom × 5
step-definitions × 5
page-factory × 4
rest-assured × 4
intellij × 4
test-management × 3
selenium2 × 3