I am very new to using cucumber (started today).
It seems simple enough but I am having issues running a basic feature.
Feature: Proof of concept that my framework works
Scenario: My first test
Given this is my first step
When this is my second step
Then this is my final step
I know there is no code for it to test, but I wanted it to return the fact that the scenarios are undefined.
I did some research and realised I had a .jar file which was unnecessary, I have since removed that.
I still have the following issue:
Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/lexer/Encoding
Caused by: java.lang.ClassNotFoundException: gherkin.lexer.Encoding
There some more info from the exception.
Is there any other info I should provide?
Any help would be appreciated
Rather than downloading individual jars, use a package manager to download the dependencies.
Using Maven, add the following dependencies to the pom.xml:
NB. This is currently the latest version.
Make sure to use the same version for all Cucumber dependencies.
Its an setup issue as it is not finding the required cucumber classes to interpret gherkin statements. Provide more info on the files you included in the setup.
Make sure you have the cucumber java libraries in your CLASSPATH.
I had this same problem when running through the First Steps chapter in The Cucumber for Java book.
It says to download the latest version of the Gherkin jar (among others) from
http://repo1.maven.org/maven2/info/cukes/gherkin/
Below is the listing, where, on the webpage, each one is a directory-link containing the jar. My mistake was thinking that the bottom-most version is the most recent version. It's not. For all of the other jars, the bottom-most is indeed the most recent version.
When using the bottom-most Gherkin jar, I get the CNFX exactly as you describe:
The version-number listing, as on the above webpage: