Questions tagged [gherkin]

Gherkin is the language used to write specifications for Cucumber, Specflow and similar BDD frameworks. It is a business-readable, domain-specific language that lets you describe your software’s behaviour without detailing how that behaviour is implemented.

Gherkin is the language used to write specifications for Cucumber, Specflow and similar BDD frameworks. It is a business-readable, domain-specific language that lets you describe your software’s behaviour without detailing how that behaviour is implemented.

Gherkin serves two purposes — documentation and automated tests. The third is a bonus feature — when it yells in red it’s talking to you, telling you what code you should write.

Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.

There are a few conventions:

  • A single Gherkin source file contains a description of a single feature.
  • Source files have the extension .feature.
  • There is a fundamental pattern to each Gherkin scenario, with a context: (Given), an event (When), and an outcome (Then).

Gherkin was invented by Alsak Hellesoy.

You can read more about Gherkin here: https://github.com/cucumber/gherkin/wiki

Documentation of Cucumber and Gherkin: https://www.cucumber.io/

.NET implementation: http://www.specflow.org/

Python implementation: https://behave.readthedocs.io/

1169 questions
-1
votes
1 answer

Calling a variable by passing variable name as a string

I've got a list of variables. Let's call it a=1,b=2,c=3. I would like to pass the variable name to a function as a string and then retrieve its' value. Is there a way to achieve this in PHP? I', hoping to use this in page object pattern with Gherkin…
Pubudu
  • 478
  • 1
  • 6
  • 22
-1
votes
2 answers

Ignoring special character in the cucumber parameterized data

I have a cucumber scenario in which I have to pass the data, and the data contains special characters. And when I execute it fails at the assertion. Below is my scenario: Scenario Outline: ABTA data Given a customer is on the "" page …
shashank sinha
  • 61
  • 2
  • 12
-1
votes
1 answer

not able to escape regex using karate framework on IntelliJ

I'm testing a web service using karate framework using IntelliJ. By framework definition, I should be able to use regex to assert XML responses and I have been able to use it to some extent. But the problem arises when I want to assert using regex…
marelc
  • 63
  • 1
  • 9
-1
votes
1 answer

Index out of Bounds Exception - when comparing two(2) lists of Strings

I am comparing two List of Strings, which finish comparing successfully, but then after, I get a - java.lang.IndexOutOfBoundsException: Index: 7, Size: 7 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at…
snikt
  • 581
  • 4
  • 11
  • 27
-1
votes
1 answer

Selenium Users › Writing better gherkin test case for cucumber

I trying to rewrite my test case in gherkin but I am not familiar with gherkin any body can help me on how to translate my case to gherkin? Thanks
MUS
  • 47
  • 2
-1
votes
1 answer

Testing same type of elements with BEHAT

I want to test a website. In this website I will get maximum 10 profiles when I click on search button. For each profile I have to check "Location text" & "Age value between max.age and min.age values". And XPath for all these Locations & Ages are…
Yella
  • 1
-1
votes
2 answers

Rails: Stack level too deep (SystemStackError) with Cucumber 1.2.4 in Windows Command Prompt 64bit

As I'm following railstutorial.org to learn cucumber, the test program keeps crashing. When I type in: bundle exec cucumber features/ to run signing_in.feature, the command line complains that: stack level too deep…
Chéng Yú
  • 51
  • 5
-2
votes
1 answer

Testing assertion with value and response time - Karate

I try to compare the response time with certain amount of time, but I don't know how to do it. I dont even know if the number I give is taken as seconds or milliseconds This is my code: Scenario: Case Given url…
-2
votes
1 answer

How to write Scenario with multiple possible outcome

This is my first attempt in writing a scenario that has multiple possible outcome. Currently the scenario covered for the happy flow. However the scenario failed due to different status detected. Getting the dynamic value (Pass and Failed) during…
xar3f
  • 1
  • 3
-2
votes
1 answer

How to write gherkin scenario directly on Xray test case creation page

How do I get the below options like test details (to add BDD scenario) when creating test cases? enter image description here On my one it just looks like this. I have imported the 6 test type from Xray into my JIRA project. Is there more…
-2
votes
4 answers

Cucumber Gherkin: Is there a way to have your gherkin features written and managed in excel sheets instead of .feature files in IntelliJ or eclipse?

Cucumber Gherkin: Is there a way to have your gherkin scenarios written and managed in excel sheets instead of .feature files in IntelliJ or Eclipse like in SpecFlow+Excel(screenshot given as link below)? I am using Cucumber-JVM with selenium for my…
-2
votes
1 answer

What is the test case format in gherkin style language?

Can we write " Given As a user I can't (cannot) login into the system" in Gherkin as a negative sentence?
Peter
  • 1
-3
votes
1 answer

How to pass hash values into fields in registration form?

I am new to automation testing and have no experience in Ruby, nor any other programming language. However my current employer wants from me to start automating small tasks. The problem I stumbled upon is when trying to pass hash values into fields…
JavaApprentice
  • 101
  • 1
  • 2
  • 10
-4
votes
1 answer

how to implement data tables in cucumber ruby ,i need an example to use both data tables and examples together from a feature file

I want to know how to implement data tables in cucumber ruby ? need an example to use both data tables and examples together from a feature file. please provide an example feature with these and their implementation files.
arbaz khan
  • 15
  • 1
  • 5
1 2 3
77
78