abbas
abbas

Reputation: 255

Undefined steps in cucumber

After running my test, Cucumber says my step is undefined. Did I do something wrong?

Feature:

Then I should see Error message for "ORIGIN" zipcode with key <messageKey>

Step definition:

@Then("^I should see Error message for \"([^\"]*)\" zipcode with key ([^\\\"]*)$")
    public void i_should_see_Error_message_for_zipcode_with_key(String location, String messageKey)

Upvotes: 0

Views: 104

Answers (1)

abbas
abbas

Reputation: 255

Finally I have got the answer. Cucumber searches between feature files and step definitions character by character; so if you have too many steps sharing the same name and cucumber confuses which is which giving you "Undefined" steps with the following error, just change the name of your stepDefs. Error: "You can implement missing steps with the snippets below:"

Upvotes: 1

Related Questions