Gherkin Language: User Stories and Scenarios
Gherkin User Stories | Gherkin Scenarios | Test Management TestQuality

Get Started

with $0/mo FREE Test Plan Builder or a 14-day FREE TRIAL of Test Manager

  • GIVEN (setup data such as hardware or data)
  • THEN (defines the result or consequence)

In a Feature file, the first step for each SCENARIO is to run all the Gherkin statements between the BACKGROUND statement and the first SCENARIO. That implies two things:

  • For each given group of SCENARIOS, there can be only one BACKGROUND statement.
  • All SCENARIO statements used to test a User Story, Feature, etc., must follow the BACKGROUND statement.
  • While you have some BACKGROUND information, it's easier to avoid unnecessary repetition when creating SCENARIOS.
  • A SCENARIO has no variables, but constants.
  • An EXAMPLE TABLE populates a Scenario OUTLINE's variables.
  • One SCENARIO will be run for each entry in the example table.
  • A Scenario Outline may include limitless EXAMPLES.

Newest Articles

Best Unit Testing Frameworks in Selenium for Test Automation
Best practices on How to write effective Test Cases in Software Testing
In the dynamic world of software development, quality is paramount. Every line of code, every feature, every functionality needs to… Continue reading Best practices on How to write effective Test Cases in Software Testing
When you should not be using Selenium for Testing
There are a wide variety of automated testing tools available, each with its own set of advantages and disadvantages. Automating tasks… Continue reading When you should not be using Selenium for Testing

© 2025 Bitmodern Inc. All Rights Reserved.