Step does not have a matching glue code error in cucumber eclipse

Chathurika Prabodani picture Chathurika Prabodani · Apr 4, 2016 · Viewed 24.1k times · Source

I am trying to run a feature file which mentioned follows.

Feature: Prove the concept of my script

  Scenario: My first Test
    Given This is my first step
    When This is my second step
    Then This is my third step

and when I run this feature file, it give an error that says the follows and the steps have been highlighted with the statement of "Steps does not have a glue code."

The error is shown as below. I want to run the above feature file and get to know the missing files of the feature.

Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/lexer/Encoding
    at cucumber.runtime.FeatureBuilder.read(FeatureBuilder.java:154)
    at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:115)
    at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:104)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34)
    at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:235)
    at cucumber.runtime.Runtime.run(Runtime.java:110)
    at cucumber.api.cli.Main.run(Main.java:36)
    at cucumber.api.cli.Main.main(Main.java:18)
Caused by: java.lang.ClassNotFoundException: gherkin.lexer.Encoding
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 9 more

Please, I am a starter to cucumber and I want to resolve this problem. Please help me if you can.

Answer

Thomas Sundberg picture Thomas Sundberg · Apr 5, 2016

Your exception tells me that you are missing a dependency.

I would clone https://github.com/cucumber/cucumber-java-skeleton or download it as a zip and get it up and running. This would hopefully tell what's wrong with your setup.