Question: Is it possible to iterate through a variable inside a scenario like a scenario outline? I have a scenario like this where i used to
Is it possible to iterate through a variable inside a scenario like a scenario outline?
I have a scenario like this where i used to save the operator abbreviations in a variable (once i retrieve the operator abbr , i will have a list of strings in that operatorAbbr variable). the count of the size of the operator abbr cant be predicted. for everyday that will be different, so list size is not available
Scenario: Scenario1 Given I set the test environment to "$env$" And I retrieve the details for the operator(s) from the database and save in variable "$operatorAbbr$" | DAYKEY | $DAYKEY$ | | MODE | $MODE$ |
This is the scenario i created to retrieve the information from the database is working fine.
Now i want to operate on each operator abbreviations (list i saved) . Is there a way to operate over this variable $operatorAbbr$ using a foreach loop or like an Scenario Outline with an example avoiding the step
And I retrieve the details for the operator(s) from the database and save in variable "$operatorAbbr$"
I am expecting something like this
Scenario Outline: Scenario1 Given I set the test environment to "$env$" And I retrieve the details for the operator(s) from the database and save in variable "$operatorAbbr$" | DAYKEY | $DAYKEY$ | | MODE | $MODE$ | | ENV | $env$ |
Examples:
|ForEach($operatorAbbr$)|
Please help.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
