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.
20 example questions
1. "Reports generated from features that stay in sync with behavior" — in Cucumber, this describes which of the following?
- A. Living documentation.correct
- B. Given.
- C. Cucumber expression {string}.
- D. Dry-run.
Why: living documentation: Reports generated from features that stay in sync with behavior.
2. "Mode verifying every step has a matching definition without executing" — in Cucumber, this describes which of the following?
- A. Given.
- B. Glue.
- C. Then.
- D. Dry-run.correct
Why: dry-run: Mode verifying every step has a matching definition without executing.
3. "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.
4. "Parameter placeholder capturing quoted text into a step argument" — in Cucumber, this describes which of the following?
- A. Dry-run.
- B. Given.
- C. Cucumber expression {string}.correct
- D. Feature.
Why: cucumber expression {string}: Parameter placeholder capturing quoted text into a step argument.
5. "Configuration pointing Cucumber to step definition packages" — in Cucumber, this describes which of the following?
- A. Cucumber expression {string}.
- B. Then.
- C. Glue.correct
- D. Feature.
Why: glue: Configuration pointing Cucumber to step definition packages.
6. "Table of values consumed by a Scenario Outline" — in Cucumber, this describes which of the following?
- A. Glue.
- B. Examples.correct
- C. Dry-run.
- D. Living documentation.
Why: Examples: Table of values consumed by a Scenario Outline.
7. Which statement correctly describes Cucumber?
- A. Scenario Outline runs a scenario exactly once regardless of Examples rows.
- B. Hooks in Cucumber cannot be restricted to specific tags.
- C. Gherkin scenarios use Given-When-Then to describe behavior in business-readable language.correct
- D. Cucumber can only be used with the Java programming language.
Why: Given sets context, When performs the action, Then asserts the outcome.
8. Which of the following statements about Cucumber is TRUE?
- A. Hooks in Cucumber cannot be restricted to specific tags.
- B. Data Tables pass structured tabular data into a single step.correct
- C. Tags in Cucumber are purely decorative and cannot filter execution.
- D. Gherkin feature files contain the automation code itself.
Why: Step code receives the table for iteration or transformation.
9. "Step asserting the expected observable outcome" — in Cucumber, this describes which of the following?
- A. Feature.
- B. Examples.
- C. Then.correct
- D. Given.
Why: Then: Step asserting the expected observable outcome.
10. Identify the accurate statement about Cucumber:
- A. Background steps run only before the first scenario in a feature.
- B. Cucumber can only be used with the Java programming language.
- C. Scenario Outline runs a scenario exactly once regardless of Examples rows.
- D. Scenario Outline with an Examples table runs the same scenario with multiple data rows.correct
Why: Outlines are Gherkin's data-driven mechanism.
11. In Cucumber, which of the following is described as: "Parameter placeholder capturing quoted text into a step argument"?
- A. Glue.
- B. Dry-run.
- C. Cucumber expression {string}.correct
- D. Given.
Why: cucumber expression {string}: Parameter placeholder capturing quoted text into a step argument.
12. Which Cucumber concept matches this description: "Mode verifying every step has a matching definition without executing"?
- A. Examples.
- B. Dry-run.correct
- C. Cucumber expression {string}.
- D. Given.
Why: dry-run: Mode verifying every step has a matching definition without executing.
13. In Cucumber, which of the following is described as: "Step establishing the initial context or preconditions"?
- A. Then.
- B. Feature.
- C. Given.correct
- D. Living documentation.
Why: Given: Step establishing the initial context or preconditions.
14. 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.
15. In the context of Cucumber, which of the following is a correct statement?
- A. Background steps run only before the first scenario in a feature.
- B. Gherkin scenarios use Given-When-Then to describe behavior in business-readable language.correct
- C. Hooks in Cucumber cannot be restricted to specific tags.
- D. Cucumber can only be used with the Java programming language.
Why: Given sets context, When performs the action, Then asserts the outcome.
16. Which Cucumber concept matches this description: "Configuration pointing Cucumber to step definition packages"?
- A. Glue.correct
- B. Living documentation.
- C. Cucumber expression {string}.
- D. Dry-run.
Why: glue: Configuration pointing Cucumber to step definition packages.
17. 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.
18. In Cucumber, which of the following is described as: "Top-level Gherkin keyword describing the capability under test"?
- A. Examples.
- B. Dry-run.
- C. Feature.correct
- D. Cucumber expression {string}.
Why: Feature: Top-level Gherkin keyword describing the capability under test.
19. In Cucumber, which of the following is described as: "Reports generated from features that stay in sync with behavior"?
- A. Living documentation.correct
- B. Glue.
- C. Given.
- D. Cucumber expression {string}.
Why: living documentation: Reports generated from features that stay in sync with behavior.
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. Glue.
- C. Examples.
- D. Living documentation.
Why: dry-run: Mode verifying every step has a matching definition without executing.