Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the purpose of the Background keyword in Cucumber?
Answer: Background is used to define a set of steps that are common to all scenarios in a feature, helping to reduce duplication of steps.

Example:

Feature: Shopping Cart
  Background:
    Given a user is logged in
  Scenario: Add item to cart
    When the user adds an item to the cart
    Then the cart should display the item
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook