Getting parsing error in the .feature file (Cucumber) | Selenium Forum
M
Posted on 18/01/2016
Hi Ashish / All

I am getting parsing error upon running cucumber basics

Feature: Life of IT tester

In order to get good salary
As an IT guy
I want to keep my boss happy

Scenario: I am a bad tester

Given I am a "<TesterType>" tester
When I go to work
Then I "<Work_Output>" it
And My boss "<Boss_Action>" me
But The developer "<Developer_Reaction>" me

Examples:
| TesterType | Work_Output | Boss_Action | Developer_Reaction |
| Good | Complete | Salute | Hates |
| Bad | Mess | Fires | Likes |
| Avg | Sufficient | Congrates | Respects |


Below is the error


cucumber.runtime.CucumberException: Error parsing feature file com/learning/cucumber/resource/tester.feature
at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:133)
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.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:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
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:33)
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:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: gherkin.parser.ParseError: Parse error at com/learning/cucumber/resource/tester.feature:15. Found examples when expecting one of: comment, doc_string, row, scenario, scenario_outline, step, tag. (Current getState: step).
at gherkin.parser.Parser$Machine.event(Parser.java:207)
at gherkin.parser.Parser.event(Parser.java:159)
at gherkin.parser.Parser.examples(Parser.java:124)
at gherkin.lexer.En.scan(En.java:780)
at gherkin.lexer.I18nLexer.scan(I18nLexer.java:36)
at gherkin.parser.Parser.parse(Parser.java:62)
at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:131)
... 23 more

M
Replied on 18/01/2016

[quote="jabbarali.mirza@gmail.com":24oj78kq]
[color=#FF0000:24oj78kq]Scenario Outline[/color:24oj78kq]: I am a bad tester

Given I am a "<TesterType>" tester
When I go to work
Then I "<Work_Output>" it
And My boss "<Boss_Action>" me
But The developer "<Developer_Reaction>" me

Examples:
| TesterType | Work_Output | Boss_Action | Developer_Reaction |
| Good | Complete | Salute | Hates |
| Bad | Mess | Fires | Likes |
| Avg | Sufficient | Congrates | Respects |

[/quote:24oj78kq]


M
Replied on 03/06/2017

Hi Ashish,

I am stuck with the same scenario which is mentioned below, i am also getting the same type of error at the same scenario please help us out on this so that we can proceed further with this cource


M
Replied on 03/06/2017

The solution to this is to just restart your eclipse, just restart the eclipse and everything will work as expected. Did NOT got the root cause of this issue as it was working fine after eclipse restart.


M
Replied on 04/06/2017

post your error here.