Cucumber: undefined steps in cucumber-jvm although step is definitely defined.

Hi all,
I'm having problem when executing the test-script which is designed with Cucumber framework with Java.
I have created step following:
Feature: Try to login in Testsite
Scenario: Login Successfully
Given User goes to Login Page
When Enter "//*[@id='login-username']" as "userName"
When Enter "//*[@id='login-password']" as "Password"
And Click "div>button.btn.btn-lg.btn-primary.btn-block"
Then Verify title page equal "Demo – Welcome"

==> Then I define @Given step as below:
{code lang=java}
@Given("^User goes to Login Page$")
public void User_goes_to_Login_Page() throws Throwable {
driver = new FirefoxDriver();
throw new PendingException();

==> The cucumber states after executing:
Wrong test finished. Last started: [] stopped: Scenario: Login Successfully; class org.junit.runner.Description

Scenario: Login Successfully # src/test/java/test/test.feature:2
Given User goes to Login Page
When Enter "//*[@id='login-username']" as "userName" # test.enterTxtField(String,String)
When Enter "//*[@id='login-password']" as "Password" # test.enterTxtField(String,String)


From the statements, the runner understands the another steps, but cannot find the implemented method for @Given. It worked before, but now cann't.
Please help.


  1. Thanh Huynh


    I’d love to help but I don’t have any experience with Cucumber. Also the question is technical that it’s hard to debug without see the problem. Anyway, let’s see if we are having Cucumber expert here and ready to give suggestion 😀

  2. Phuoc Nguyen

    Thanks anh. 😉

Leave a Reply

Your email address will not be published.

© 2021 AskTester

Theme by Anders NorenUp ↑