问题
Feature: Title of your feature
Scenario Outline: Login to the application
Given Application is launched
When I check for the <username> in step
When I verify the <password> in step
Then I login to the application
Examples:
| username | password |
| admin | Admin123 |
Method Implemented in Step Definition Class:
@When("^I check for the \"([^\"]*)\" in step$")
public void i_check_for_the_admin_in_step(String arg1) throws Throwable {
driver.findElement(By.id("username")).sendKeys(arg1);
}
@When("^I verify the \"([^\"]*)\" in step$")
public void i_verify_the_Admin_in_step(String arg2) throws Throwable {
driver.findElement(By.id("password")).sendKeys(arg2);
}
Error in consoles on running the code :
@When("^I check for the admin in step$")
public void i_check_for_the_admin_in_step() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^I verify the Admin(\\d+) in step$")
public void i_verify_the_Admin_in_step(int arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
Please let me know how to proceed further or what changes needs to be done. Version of cucumber : 1.2.5 Selenium : 2.53
来源:https://stackoverflow.com/questions/43575235/cucumber-not-able-to-recognize-the-implemented-methods