Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
729 views
in Technique[技术] by (71.8m points)

java - Exception in thread "main" cucumber.runtime.CucumberException: No backends were found

I am developing my Selenium-JVM framework with Cucumber and while running my first feature got below error.

Please help.

How did I launch the feature -

  1. Right click on feature file
  2. Select Run As -> Cucumber Feature

Immediate Exception -

Exception in thread "main" cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
    at cucumber.runtime.Runtime.<init>(Runtime.java:78)
    at cucumber.runtime.Runtime.<init>(Runtime.java:67)
    at cucumber.runtime.Runtime.<init>(Runtime.java:63)
    at cucumber.api.cli.Main.run(Main.java:24)
    at cucumber.api.cli.Main.main(Main.java:16)

What I have in code -

Launcher.java -

package cucumber;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(format={"pretty","json:target/"} , features="/src/test/java/cucumber/features")
public class Launcher {

}

Feature file -

Feature: it works demo

  Scenario: First test
    Given this is my step
    When this is my second step
    Then this is my final step

List of Dependencies added to list -

cucumber-core-1.1.8
cucumber-html-0.2.3
cucumber-java-1.1.8
cucumber-junit-1.1.8
cucumber-jvm-deps-1.0.3
gherkin-2.12.2
hamcrest-all-1.3
junit-4.11
selenium-api-2.42.2
selenium-firefox-driver-2.42.2
selenium-java-2.42.2
selenium-remote-driver-2.42.2
selenium-support-2.42.2

My JVM - 1.7

Only this much is available in project.

Please help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This error is thrown when no 'backends' are found on the classpath. There is a 'backend' for each supported language (e.g. cucumber-java, cucumber-groovy etc.)

It's probably a classpath error, although if cucumber-core and cucumber-java are in the same location that does seem strange.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...