黄瓜无法识别实施的方法

时间:2017-04-23 18:58:02

标签: cucumber

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 |

在步骤定义类中实现的方法:

    @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();
}

请告诉我如何进一步处理或需要进行哪些更改。 黄瓜版本:1.2.5 硒:2.53

0 个答案:

没有答案
相关问题