I have got a scenario outline
Scenario Outline:
When I type "<text>" in the search bar
With examples
Examples:
|text|
|laptop|
|camera|
And its Step Definition
@When("^I type \"([^\"]*)\" in the search bar$")
public void iTypeInTheSearchBar(String text){
try {
homepage.searchForItem(text);
}
catch (NullPointerException e){
logger.debug("Exception",e);
}
}
But when I run the test, in each iteration, instead of entering the parameters defined in examples (laptop,camera....), it literally keeps entering "text" in the search bar. I have also tried re-writing the scenario outline and examples as follows
Scenario Outline:
When I type <text> in the search bar
Examples:
|text|
|"laptop"|
|"camera"|
But still no luck. I have never faced this issue before, does anyone know what I am doing wrong? Following are the libraries I am using (JDK is 1.8)
dependencies {
compile group: 'info.cukes', name: 'cucumber-junit', version: '1.2.5'
// https://mvnrepository.com/artifact/info.cukes/cucumber-java
compile group: 'info.cukes', name: 'cucumber-java8', version: '1.2.5'
}
I am calling the test through Junit class
@RunWith(Cucumber.class)
@CucumberOptions(features="src/test/resources",glue= "StepDefinitions",plugin = "pretty")