title: When I have a matching glue code eclipse throws the following error - Step 'User is already on loginpage' does not have a matching glue code
body: <p>I'm unable to run my runner file in eclipse as eclipse says Step -'User is already on loginpage' does not have a matching glue code on my feature file. </p>
  
  <p>Also when I close and open the feature file eclipse says- An internal error occurred during: "Scanning for step definitions".
      java.lang.NullPointerException </p>
  
  <p>When I run the runner file Ecipse shows the below error </p>
  
  <p>You can implement missing steps with the snippets below:</p>
  
  <pre><code>@Given("^User is already on loginpage$")
  public void user_is_already_on_loginpage() throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
  } .....
  </code></pre>
  
  <p>I have tried specifying the path to my feature file and step definition file in so many different ways, but nothing has worked.</p>
  
  <p>Feature file</p>
  
  <blockquote>
    <p>Feature: Free CRM login feature</p>
    
    <p>Scenario: CRM login</p>
    
    <p>Given User is already on loginpage</p>
    
    <p>When title of login pageis free CRM</p>
    
    <p>Then user enters user name an d password</p>
    
    <p>Then user clicks on login button</p>
    
    <p>Then user is on homepage</p>
  </blockquote>
  
  <p>Step Definition File</p>
  
  <pre><code>    package stepDefinitions;
      import org.openqa.selenium.chrome.ChromeDriver;
      import org.openqa.selenium.*;
  
      import cucumber.api.java.en.*;
      import org.junit.Assert;
  
  
      public class LogInStepDefinition {
  
      WebDriver driver;
  
      @Given("^User is already on loginpage$")
  
      public void User_is_already_on_loginpage() {
          driver=new ChromeDriver();
          System.setProperty("webdriver.chrome.driver", 
          "C://chromedriver.exe");
          driver.get("http://testing-ground.scraping.pro/login");
      }
  
      @When("^title of login pageis free CRM$")
  
      public void title_ofloginpage_is_free_CRM() {
          String ActualTitle=driver.getTitle();
          Assert.assertEquals("Web Scraper Testing Ground", ActualTitle);
      }
  
      @Then("^user enters user name an d password$")
      public void user_enters_user_name_and_password()  {
  
      driver.findElement(By.id("usr")).sendKeys("admin");
      driver.findElement(By.id("pwd")).sendKeys("12345");
      }
  
  
      @Then("^user clicks on login button$")
      public void user_clicks_on_login_button()  {
          driver.findElement(By.xpath("//*[@id='case_login']/form/input[3]")).click();
      }
  
      @Then("^user is on homepage$")
      public void user_is_on_homepage()  {
  
          String pageVeri=driver.findElement(By.xpath("//*[@id='content']/div[@id='case_login']/h3[@class='success']")).getText();    
          Assert.assertEquals("WELCOME :)", pageVeri);;
      }   
      }
  </code></pre>
  
  <pre><code>Runner file
  </code></pre>
  
  <pre><code>    package Runner;
  
      import org.junit.runner.RunWith;
      import cucumber.api.CucumberOptions;
      import cucumber.api.junit.Cucumber;
  
      @RunWith(Cucumber.class)
  
      @CucumberOptions(
      features="src/main/java/Features/login.feature",
      glue= {"/src/main/java/stepDefinitions/LogInStepDefinition.java"}
      //format= {"pretty","html:test-output"}
      )
  
      public class TestRunner {
  
      }
  </code></pre>
  
  <p>POM.xml</p>
  
  <pre><code>    &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;FreeCRMBDDFramework&lt;/groupId&gt;
      &lt;artifactId&gt;FreeCRMBDDFramework&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;FreeCRMBDDFramework&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
      &lt;dependency&gt;
      &lt;groupId&gt;info.cukes&lt;/groupId&gt;
      &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
      &lt;version&gt;1.2.5&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  
  
  
      &lt;dependency&gt;
      &lt;groupId&gt;info.cukes&lt;/groupId&gt;
      &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
      &lt;version&gt;1.2.5&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
      &lt;groupId&gt;info.cukes&lt;/groupId&gt;
      &lt;artifactId&gt;cucumber-jvm&lt;/artifactId&gt;
      &lt;version&gt;1.2.5&lt;/version&gt;
      &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&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;dependency&gt;
      &lt;groupId&gt;info.cukes&lt;/groupId&gt;
      &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
      &lt;version&gt;1.2.5&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&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;dependency&gt;
      &lt;groupId&gt;net.masterthought&lt;/groupId&gt;
      &lt;artifactId&gt;cucumber-reporting&lt;/artifactId&gt;
      &lt;version&gt;4.5.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
      &lt;groupId&gt;info.cukes&lt;/groupId&gt;
      &lt;artifactId&gt;gherkin&lt;/artifactId&gt;
      &lt;version&gt;2.12.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;3.8.1&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&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.5.3&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/info.cukes/cucumber-picocontainer 
      --&gt;
  
      &lt;dependency&gt;
      &lt;groupId&gt;info.cukes&lt;/groupId&gt;
      &lt;artifactId&gt;cucumber-picocontainer&lt;/artifactId&gt;
      &lt;version&gt;1.2.5&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
      &lt;groupId&gt;info.cukes&lt;/groupId&gt;
      &lt;artifactId&gt;cucumber-core&lt;/artifactId&gt;
      &lt;version&gt;1.2.5&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  
      &lt;/dependencies&gt;
      &lt;/project&gt;
  </code></pre>