Mobile QA Zone

A Mobile Application Testing Community

What are the various keywords that are used in Cucumber for writing a scenario?

Views: 13

Reply to This

Replies to This Discussion

In Cucumber, test cases are written in Gherkin syntax.

Gherkin tests are structured by test automation services for defining the scenario using simple English language.

Below are the steps followed while creating Gherkin:

The scenarios should be developed using Given, Event and Result. The Gherkin steps are defined using the keywords “Given”, “When” and “Then”.

The “Given” should defined pre-requisites and “When” defines the test actions.

“Then” declares the verification step and “AND” is used to declare multiple steps between “Given”, “When” and “Then”.

“Feature” or “Scenario” tags are implemented with “@” for reusability.

Background is executes before every scenario declared in the feature file.

Below is the Gherkin Syntax:


Given the following user exists

| First Name | Last Name | Is Admin |CSV file|

| User | U1 | true | CSVfile1 |

And the CSV " CSVfile1" file have valid data

And "User U1" is logged in

And the user is on the "TestingModule" page


Scenario: Verification of uploaded data on TestingModule page

When the user clicks the "Upload"

And the user selects "Option1" from the "detailed" drop down

And the user clicks "Choose File" and the user select "CSVfile1"

Then the user should see name under the "Name" column

And the user should see emailid under the "Email" column

And the user should see Errors under “Invalid” column


© 2019   Created by Anurag Khode.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.