Getting error with cucumber setup

Hi,

I followed the steps for the cucumber setup but  getting error when I  run the TestRunner junit class
Getting error with cucumber setup

How to proceed?

som Train Asked on February 11, 2015 in Selenium WebDriver.
Add Comment
4 Answer(s)

For you to have the features = “Features” work you need to have a Folder named feature in the project folder. Show us the package explorer view also.

If you dont have Feature folder containing feature in the root of your project this error will come.

Thanks
Virender

Virender Singh Professor Answered on February 23, 2015.
Add Comment

Hi virender

Here is screenshot of package explorer

RE: Getting error with cucumber setup
som Train Answered on February 23, 2015.
Add Comment

Hey guys,

I’m experiencing the same issue as described above. The difference between the tutorial and my setup is that some of the jar files are newer versions and i’m using Eclipse: Luna Service Release 2 (4.4.2). I searched for a solution to this and found several ideas but none worked.

*********************
This is pasted from the Failure Trace panel:

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:102)
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:201)
at cucumber.api.junit.Cucumber.<init>(Cucumber.java:60)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
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)
… 25 more

****************************

I must note i’m pretty new to Test Automation and have limited experience using Selenium WebDriver with Java in Eclipse.

aloha Default Answered on April 28, 2015.
Add Comment

Hey there,

My issue was apparently caused by the fact that i had downloaded an older gherkin jar version from the maven repository :) . I replaced it with the latest one (2.12.2) and everything works as expected.

Cheers

aloha Default Answered on May 8, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.