Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the Lexing Errors in Cucumber?

Tags:

cucumber

I was trying to run a simple Feature file but i was getting Exception like : Exception in thread "main" cucumber.runtime.CucumberException: Error parsing feature file.

which is Caused by: gherkin.lexer.LexingError: Lexing error

i am trying to parametrized a When statement and got this Exception:

Scenario: Login to Gmail

  Given User is on Gmail login page
  When User enters <userName> and <pwd>
  And Clicks on login button
  Then User should redirect to home page

  scenario outline(tried Examples as well but didn't worked): 
  |userName   | pwd |
  |ravivani10 | abc |
like image 288
RavindraS Avatar asked Nov 11 '14 11:11

RavindraS


1 Answers

The correct syntax for a scenario outline is to start with the keyword Scenario Outline: and list the examples with the Examples: keyword.

Scenario Outline: Login to Gmail
  Given User is on Gmail login page
  When User enters <userName> and <pwd>
  And Clicks on login button
  Then User should redirect to home page
Examples:
  | userName   | pwd |
  | ravivani10 | abc |
like image 72
Jörn Horstmann Avatar answered Sep 27 '22 21:09

Jörn Horstmann