Testing / Karate Framework Interview questions
What is a Scenario Outline in Karate?
A Scenario Outline defines a single scenario template with placeholder values, then runs it once per row of data supplied in an accompanying Examples table, avoiding the need to copy-paste near-identical scenarios for each input variation.
Scenario Outline: create a user with different roles Given url 'https://api.example.com/users' And request { name: '<name>', role: '<role>' } When method post Then status <expectedStatus> Examples: | name | role | expectedStatus | | Alice | admin | 201 | | Bob | viewer | 201 | | Eve | "" | 400 |
Each row in the Examples table produces one independent scenario execution, with the placeholder values (in angle brackets) substituted in for that run, which makes the report show each variation as its own pass/fail result rather than lumping them together.
More Related questions...