- Real-Time-Automation
Scenario Outline in Cucumber Feature File
Using Scenario outline keyword we can achieve data-driven. We can run a single scenario with multiple data using examples keyword.
We try to understand the scenario outline with below example.
@sprint1
Feature: validate the login Functionality
Scenario Outline: validate the negative login functionality
Given Navigate to utest url
When Click on sign in link
And Enter email "<EMAIL>"
And Click on sign in button
Then validate the error message "<EXPECTED>"
Examples:
| EMAIL | EXPECTED |
| school@gmail.com | Invalidusernameorpassword. |
| school1@gmail.com | Invalidusernameorpassword. |
In the above example, EMAIL and EXPECTED are parameterized with help of examples.
we are able to run the same scenario with multiple data.
Things to Remember
Always use "<parameter_name>" for parameterizing the values.
At the end of the Scenario Outline, values are defined in a pipe-delimited table format using Examples.
Examples:
| Parameter_Name1 | Parameter_Name2 |
| Value-1 | Value-2 |
| Value-X | Value-Y |
17 views0 comments