Getting runtime.cucumberexception for error parsing feature file

0 votes

When I execute feature file where I have written my scenarios, it throws an exception. How to resolve this

Exception in thread "main" cucumber.runtime.CucumberException: Error parsing feature file C:/Users/XXX/XXXX/src/test/java/RunTest.java
    at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:133)
    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.runtime.Runtime.run(Runtime.java:109)
    at cucumber.api.cli.Main.run(Main.java:36)
    at cucumber.api.cli.Main.main(Main.java:18)
Caused by: gherkin.lexer.LexingError: Lexing error on line 1: 'package test.java;

import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;

    @CucumberOptions(features="src/test/resources/")
    public class RunTest extends AbstractTestNGCucumberTests {
    }
May 17 in Selenium by Neha
• 6,140 points
24 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
First check if there is any extra space ? Or just know if there is semicolon or something as such. If no then try to check if the Jar files are properly configured. If everything is fine, then make sure your feature file is written as shown below and the step definitions are implemented.

Feature: Reset functionality on login page of Application

Scenario: Verification of Reset button

Given Open the Firefox and launch the application

When Enter the Username and Password

Then Reset the credential

I hope this helps :)
answered May 17 by Frankie
• 9,590 points

Related Questions In Selenium

0 votes
1 answer

Getting error while running a XML file in TestNG

Hello @Sradha, The synatx of using test is ...READ MORE

answered Dec 26, 2018 in Selenium by Rashmi
152 views
0 votes
1 answer
0 votes
1 answer

Error with Selenium File Upload

In your code, you have used "WebElement" ...READ MORE

answered Mar 29, 2018 in Selenium by nsv999
• 5,030 points
612 views
0 votes
1 answer

dBase for my website always gives me this error “Invalid syntax”

Seems like you are missing a close ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,030 points
31 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,030 points
77 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
449 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
57 views
0 votes
1 answer

How to Install XPath Helper Plugin for Chrome Browser?

1) Go to https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl?hl=en 2) Click on Add to Chrome. 3) ...READ MORE

answered Jan 17 in Selenium by Frankie
• 9,590 points
97 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.