title: Undefined Step definitions in Cucumber Java
body: <p>I added the login steps in Login class. But when I run the scenario from the Login.feature file I still get undefined steps error.</p>
  <p>Login class</p>
  <pre><code>package stepDefinitions;
  
  import io.cucumber.java.en.And;
  import io.cucumber.java.en.Given;
  import io.cucumber.java.en.Then;
  import io.cucumber.java.en.When;
  
  public class Login {
  
      @Given(&quot;I am on the login page&quot;)
      public void ı_am_on_the_login_page() {
          // Write code here that turns the phrase above into concrete actions
          throw new io.cucumber.java.PendingException();
      }
  
      @When(&quot;I enter a correct e-mail address&quot;)
      public void ı_enter_a_correct_e_mail_address() {
          // Write code here that turns the phrase above into concrete actions
          throw new io.cucumber.java.PendingException();
      }
  
      @And(&quot;I enter a correct password&quot;)
      public void ı_enter_a_correct_password() {
          // Write code here that turns the phrase above into concrete actions
          throw new io.cucumber.java.PendingException();
      }
  
      @And(&quot;I click on login button&quot;)
      public void ı_click_on_login_button() {
          // Write code here that turns the phrase above into concrete actions
          throw new io.cucumber.java.PendingException();
      }
  
      @Then(&quot;I should be presented with successful login message&quot;)
      public void ı_should_be_presented_with_successful_login_message() {
          // Write code here that turns the phrase above into concrete actions
          throw new io.cucumber.java.PendingException();
      }
  
  }
  
  </code></pre>
  <p>This is my Login.feature file</p>
  <pre><code>Feature: Login page
  
    Scenario: Successful login test
      Given I am on the login page
      When I enter a correct e-mail address
      And I enter a correct password
      And I click on login button
      Then I should be presented with successful login message
  </code></pre>
  <p>pom.xml file</p>
  <pre><code>
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
           xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
           xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;org.example&lt;/groupId&gt;
      &lt;artifactId&gt;Segmentify_Project&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;17&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;17&lt;/maven.compiler.target&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;4.1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
              &lt;version&gt;7.3.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-testng&lt;/artifactId&gt;
              &lt;version&gt;7.3.3&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>
  <p>This is the project format</p>
  <p><a href="https://i.stack.imgur.com/Ebuef.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I receive the following error when I run the scenario from Login.feature</p>
  <p>Step undefined
  You can implement this step and 4 other step(s) using the snippet(s) below:</p>
  <pre><code>@Given(&quot;I am on the login page&quot;)
  public void ı_am_on_the_login_page() {
      // Write code here that turns the phrase above into concrete actions
      throw new io.cucumber.java.PendingException();
  }
  </code></pre>