Testing / Cucumber Interview Questions
What is a Scenario Outline in Cucumber?
A Scenario Outline defines a single scenario template containing placeholders, then runs it once for each row of a paired Examples table, avoiding the need to write nearly identical scenarios by hand for each combination of inputs.
Scenario Outline: login attempts with different credentials Given a registered user "alice" with password "correct-password" When "alice" attempts to log in with password "<attemptedPassword>" Then the login result should be "<expectedResult>" Examples: | attemptedPassword | expectedResult | | correct-password | success | | wrong-password | failure | | | failure |
Cucumber expands a Scenario Outline internally into one independent scenario execution per Examples row, each reported separately in results, which is how a single readable template can cover many input variations without the report collapsing them into one ambiguous pass/fail result.
More Related questions...