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, 2019 in Selenium by Neha
• 6,300 points
29,013 views

1 answer to this question.

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, 2019 by Frankie
• 9,830 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
16,422 views
0 votes
1 answer

Sikuli file upload, even after writing the correct script getting error. Any solution?

Hey, @Faha, This error message... JavaScript error: resource://gre/modules/XULStore.jsm, line ...READ MORE

answered Dec 15, 2020 in Selenium by Gitika
• 65,770 points
2,549 views
0 votes
0 answers

For conditions 2 and 3 getting error Class cast exception. Any solution?

public class ScrollingPage { public static void main(String[] ...READ MORE

Dec 25, 2020 in Selenium by faha
• 380 points
1,264 views
0 votes
1 answer
0 votes
2 answers

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,500 points
13,773 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,188 views
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,910 points
7,263 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,902 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, 2019 in Selenium by Frankie
• 9,830 points
3,570 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP