cucumber not able to recognize the implemented methods

丶灬走出姿态 提交于 2019-12-25 09:25:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!