1
votes

I'm new in java cucumber.

When run runTest fail:

cucumber.runtime.CucumberException: No features found at []

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.47.1</version>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.0.2</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.0.2</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>

java class:

import org.junit.runner.RunWith;
import cucumber.junit.Cucumber; 

@RunWith(Cucumber.class) 
@Cucumber.Options(format = {"pretty", "html:target/cucumber"}) 

public class runTest { }

feature file:

Feature: annotation
"#"This is how background can be used to eliminate duplicate steps

Background: User navigates to Facebook Given I am on Facebook login page

"#"Scenario with AND Scenario: When I enter username as "TOM" And I enter password as "JERRY" Then Login should fail

"#"Scenario with BUT Scenario: When I enter username as "TOM" And I enter password as "JERRY" Then Login should fail But Relogin option should be available

1
Feature file should be in class pathMurthi
tried to clean up code as best I couldmiken32

1 Answers

2
votes

Please check:

If all the feature files are present under

src/test/resources

In Java class, Please add feature path as well to read the feature file.

@Cucumber.Options(format = {"pretty", "html:target/cucumber"},

features = {"src/test/resource"}

)