Skip to content

Cucumber interview questions — Medium

198 medium-level Cucumber questions from our Automation Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

Cucumber appears throughout Automation Testing interviews. At medium level, interviewers are typically checking that you have used it in practice: what you configured, what broke, and how you knew it worked. Work through these, then explain your answer out loud; the second part is what interviews actually test.

Other levels:Hard (100)Easy (98)

20 example questions

  1. 1. "Top-level Gherkin keyword describing the capability under test" — in Cucumber, this describes which of the following?

    • A. Feature.correct
    • B. Then.
    • C. Glue.
    • D. Living documentation.

    Why: Feature: Top-level Gherkin keyword describing the capability under test.

  2. 2. "Step establishing the initial context or preconditions" — in Cucumber, this describes which of the following?

    • A. Feature.
    • B. Dry-run.
    • C. Given.correct
    • D. Then.

    Why: Given: Step establishing the initial context or preconditions.

  3. 3. "Configuration pointing Cucumber to step definition packages" — in Cucumber, this describes which of the following?

    • A. Glue.correct
    • B. Cucumber expression {string}.
    • C. Living documentation.
    • D. Dry-run.

    Why: glue: Configuration pointing Cucumber to step definition packages.

  4. 4. "Mode verifying every step has a matching definition without executing" — in Cucumber, this describes which of the following?

    • A. Glue.
    • B. Then.
    • C. Feature.
    • D. Dry-run.correct

    Why: dry-run: Mode verifying every step has a matching definition without executing.

  5. 5. "Parameter placeholder capturing quoted text into a step argument" — in Cucumber, this describes which of the following?

    • A. Given.
    • B. Examples.
    • C. Cucumber expression {string}.correct
    • D. Dry-run.

    Why: cucumber expression {string}: Parameter placeholder capturing quoted text into a step argument.

  6. 6. "Table of values consumed by a Scenario Outline" — in Cucumber, this describes which of the following?

    • A. Examples.correct
    • B. Given.
    • C. Then.
    • D. Cucumber expression {string}.

    Why: Examples: Table of values consumed by a Scenario Outline.

  7. 7. "Step asserting the expected observable outcome" — in Cucumber, this describes which of the following?

    • A. Cucumber expression {string}.
    • B. Living documentation.
    • C. Then.correct
    • D. Examples.

    Why: Then: Step asserting the expected observable outcome.

  8. 8. Which statement correctly describes Cucumber?

    • A. Scenario Outline runs a scenario exactly once regardless of Examples rows.
    • B. When steps are used for assertions and Then steps for actions.
    • C. Gherkin scenarios use Given-When-Then to describe behavior in business-readable language.correct
    • D. Background steps run only before the first scenario in a feature.

    Why: Given sets context, When performs the action, Then asserts the outcome.

  9. 9. Identify the accurate statement about Cucumber:

    • A. When steps are used for assertions and Then steps for actions.
    • B. Tags in Cucumber are purely decorative and cannot filter execution.
    • C. Gherkin feature files contain the automation code itself.
    • D. Gherkin scenarios use Given-When-Then to describe behavior in business-readable language.correct

    Why: Given sets context, When performs the action, Then asserts the outcome.

  10. 10. Which of the following statements about Cucumber is TRUE?

    • A. Background steps run only before the first scenario in a feature.
    • B. Scenario Outline runs a scenario exactly once regardless of Examples rows.
    • C. When steps are used for assertions and Then steps for actions.
    • D. Data Tables pass structured tabular data into a single step.correct

    Why: Step code receives the table for iteration or transformation.

  11. 11. In the context of Cucumber, which of the following is a correct statement?

    • A. Hooks in Cucumber cannot be restricted to specific tags.
    • B. Scenario Outline runs a scenario exactly once regardless of Examples rows.
    • C. Step definitions bind Gherkin steps to executable automation code.correct
    • D. Tags in Cucumber are purely decorative and cannot filter execution.

    Why: Regular expressions or cucumber expressions match steps to methods.

  12. 12. Which Cucumber concept matches this description: "Mode verifying every step has a matching definition without executing"?

    • A. Feature.
    • B. Cucumber expression {string}.
    • C. Dry-run.correct
    • D. Then.

    Why: dry-run: Mode verifying every step has a matching definition without executing.

  13. 13. In Cucumber, which of the following is described as: "Reports generated from features that stay in sync with behavior"?

    • A. Then.
    • B. Glue.
    • C. Living documentation.correct
    • D. Given.

    Why: living documentation: Reports generated from features that stay in sync with behavior.

  14. 14. In Cucumber, which of the following is described as: "Top-level Gherkin keyword describing the capability under test"?

    • A. Examples.
    • B. Feature.correct
    • C. Glue.
    • D. Given.

    Why: Feature: Top-level Gherkin keyword describing the capability under test.

  15. 15. Which Cucumber concept matches this description: "Top-level Gherkin keyword describing the capability under test"?

    • A. Then.
    • B. Feature.correct
    • C. Given.
    • D. Dry-run.

    Why: Feature: Top-level Gherkin keyword describing the capability under test.

  16. 16. Which Cucumber concept matches this description: "Reports generated from features that stay in sync with behavior"?

    • A. Then.
    • B. Dry-run.
    • C. Living documentation.correct
    • D. Examples.

    Why: living documentation: Reports generated from features that stay in sync with behavior.

  17. 17. Which Cucumber concept matches this description: "Step establishing the initial context or preconditions"?

    • A. Given.correct
    • B. Feature.
    • C. Glue.
    • D. Examples.

    Why: Given: Step establishing the initial context or preconditions.

  18. 18. In Cucumber, which of the following is described as: "Configuration pointing Cucumber to step definition packages"?

    • A. Dry-run.
    • B. Glue.correct
    • C. Given.
    • D. Feature.

    Why: glue: Configuration pointing Cucumber to step definition packages.

  19. 19. In Cucumber, which of the following is described as: "Step establishing the initial context or preconditions"?

    • A. Feature.
    • B. Living documentation.
    • C. Given.correct
    • D. Examples.

    Why: Given: Step establishing the initial context or preconditions.

  20. 20. In Cucumber, which of the following is described as: "Mode verifying every step has a matching definition without executing"?

    • A. Dry-run.correct
    • B. Living documentation.
    • C. Examples.
    • D. Given.

    Why: dry-run: Mode verifying every step has a matching definition without executing.

Related Automation Testing topics