Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
11.1k views
by The go-to Tester (142 points)
getting this parsing error with my gherkin file

Exception in thread "main" cucumber.runtime.CucumberException: gherkin.ParserException$CompositeParserException: Parser errors:

(28:3): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'Examples:'

(32:3): inconsistent cell count within the table

at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:60)

at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:113)

at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:49)

at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:31)

at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:311)

at cucumber.runtime.Runtime.run(Runtime.java:95)

at cucumber.api.cli.Main.run(Main.java:36)

at cucumber.api.cli.Main.main(Main.java:18)

Caused by: gherkin.ParserException$CompositeParserException: Parser errors:

(28:3): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'Examples:'

(32:3): inconsistent cell count within the table

at gherkin.Parser.parse(Parser.java:143)

at gherkin.Parser.parse(Parser.java:118)

at gherkin.Parser.parse(Parser.java:114)

at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:56)

... 7 more

3 Answers

1 like 0 dislike
by

Examples can only be used with Scenario Outlines. Scenario Outlines are ways to run a scenario with different data sets.

If you change Scenario to Scenario Outline your example will work:

0 like 0 dislike
by Master (1.2k points)
It looks like you have some additional spaces or also, try to check that the formate of your feature file is right.
0 like 0 dislike
by

Feature file does not get parsed if we have an extra space between Scenario and :

Example:

Scenario : --> this will not work

Scenario:  ---> this will work


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...