Reputation: 21
So far we have a configuration.properties
where we set value for all required parameters, but I need to loop through multiple values for one of the parameters (probably comma delimited) and run all feature files for each.
Upvotes: 2
Views: 532
Reputation: 101
I do not think there is a feature in cucumber to send multiple parameters to only one of the parameters. But what we can do is in the Scenario Outline,
Feature file
Scenario Outline : Create User
Given I enter names as <names>
And I enter class as <class>
When I click Save
Then the success message is displayed
Examples:
|names |class|
|Ann,Malissa|5G |
Step definition file
@Given("I enter names as (.*)")
public void GivenIenterName(String names){
String[] nameList = names.split("\\,");
for(String x : nameList){
/*block of code
to execute*/
}
}
Upvotes: 1