【发布时间】:2014-09-18 22:26:20
【问题描述】:
我正在使用 Cucumber 开发我的 Selenium-JVM 框架,并且在运行我的第一个功能时出现以下错误。
请帮忙。
我是如何启动该功能的 -
- 右键功能文件
- 选择运行方式 -> Cucumber 功能
立即异常 -
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)
我在代码中的内容 -
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: it works demo
Scenario: First test
Given this is my step
When this is my second step
Then this is my final step
添加到列表的依赖项列表 -
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
我的 JVM - 1.7
项目中只有这么多可用。
请帮忙。
【问题讨论】:
-
你能发布你的 pom.xml 文件吗
标签: java selenium-webdriver cucumber-jvm