Gherkin Format For Behavior Driven Development
Posted By : Smita Gupta | 22-May-2018
As we know BDD is adopting by most of the companies nowadays and the technology is very much in demand for automation because of its pretty plain text feature which can be easily understandable by anyone including Business analyst, developer, manual QA or an automation test engineer.
There are many tools which are supported by BDD and these tools are written in a different language like Java, Ruby, C#.
There is one language in common for all these tools which is Gherkin.
Let’s discuss what is Gherkin and its importance in the tools and how it is making automation so easy through BDD
1. Gherkin is actually a format for cucumber specification basically it is a language specification for BDD. It is a business readable and a
2. It has some spaces and indentation to define the structures. It has a very few syntaxes which make the parser(the tool which uses gherkin) to behave based on the structures and it really makes sense because gherkin is a plain text and it will not have any syntax like a looping code like for loop, for each loop or it will not have a condition statements like if or it will not have using or import statements to input a library and other stuff . It simply looks like very simple plain text
Some of the syntax which gherkin has --
Feature
Background
Scenario
Given
And
When
Then
| userName | Password | CPassword |
And the Parsers, which actually a tool uses in gherkins know these syntaxes and knows it has to be done something based on the command which is even in the plain text
Eg of a Gherkin Plain Text file ----
Scenario --- Registering a user in a website with minimal password combination
Feature: UserRegistration
Check
See of the registration is working
Background:
Given Clear the already created users before starting scenario
Scenario: Register a User with minimal password combinations
Given I have opened the Development site
And I
When I click the register link
Then I should see the Register page
And I fill the form with details
| userName | Password | CPassword |
| xxxUser |
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Smita Gupta
Smita is a QA Engineer having experience in Manual and Automation testing and willing to take more experience and learning in new and different domains.