A Scenario Outline runs the same scenario multiple times with different data, using <placeholders> filled from an Examples table. It is Cucumber's data-driven testing mechanism.
Instead of copying a scenario for each input, you write it once with <placeholders> and provide rows in an Examples: table; Cucumber runs the scenario once per row, substituting values. This keeps specs DRY and makes adding a case a one-line table row. Each row is reported as a separate example. Placeholders can appear in any step and in DataTables/Doc Strings. Use Scenario Outline for validating multiple inputs (valid/invalid logins, boundary values, many payloads). Overusing huge Examples tables can hurt readability — keep them focused on meaningful, representative cases.
Scenario Outline: Login\n When user logs in with '<user>' and '<pass>'\n Then result is '<outcome>'\nExamples:\n | user | pass | outcome |\n | valid | valid | success |\n | valid | wrong | error |
You have five near-identical login scenarios differing only by credentials. What's the Cucumber way to consolidate them?