title: Undefined Step Reference - Intellij Java
body: <p>Well, I am creating a test automation framework with Cucumber and Java. I am able to create the step definitions and launch the tests. However, in my Gherkin feature in Intellij, it always show's me that the step is not recongised. Because of this, I cannot navigate to the implemented step definition. </p>
  
  <p>I literally tried every solution that I came across Stackoverflow</p>
  
  <p>// POM.xml - All my dependencies are in this file that are needed to support my solution. I used the latest version of all dependencies from the Maven repository</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;execute_auto&lt;/groupId&gt;
      &lt;artifactId&gt;execute_auto&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;dependencies&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-core&lt;/artifactId&gt;
              &lt;version&gt;4.7.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
              &lt;version&gt;4.5.3&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/gherkin --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;gherkin&lt;/artifactId&gt;
              &lt;version&gt;5.0.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-jvm-deps --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-jvm-deps&lt;/artifactId&gt;
              &lt;version&gt;1.0.6&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;3.141.59&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Web driver manager dependency --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;
              &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;
              &lt;version&gt;3.6.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;
              &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;
              &lt;version&gt;3.6.2&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>// StepDefinition.java - This is where I get the extracted step definitions which appear on the console when I run my test</p>
  
  <pre><code>package Steps;
  import io.cucumber.java.en.*; //I replaced cucumber.api.java.
  import Pages.*;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.support.ui.WebDriverWait;
  
  public class MyStepdefs {
  
  
      @Given("The user login to the application")
      public void the_user_login_to_the_application() {
          LoginPage login = new LoginPage(driver);
      }
  
      @When("the credentials are entered")
      public void the_credentials_are_entered() {
          // Write code here that turns the phrase above into concrete actions
          System.out.println("Print when steps");
      }
  
      @Then("the homepage is viewed")
      public void the_homepage_is_viewed() {
          // Write code here that turns the phrase above into concrete actions
          System.out.println("print then steps");
      }
  }
  </code></pre>
  
  <p>// Myfeature - this is the sample feature that I am using to automate my test case</p>
  
  <pre><code>Feature: LoginFeature
  Scenario: Log in
  Given The user login to the application
  When the credentials are entered
  Then the homepage is viewed
  </code></pre>