【问题标题】:Cucumber.class error: cannot convert from class cucumber to calls runnercucumber.class错误:无法从Class Cucumber转换为调用Runner
【发布时间】:2019-01-24 01:19:04
【问题描述】:

我在Cucumber.class 中遇到了一个错误,说

无法从类 cucumber 转换为调用 runner

这是我的代码:

package testRunners;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
//import cucumber.api.junit.Cucumber;


@RunWith(Cucumber.class)
@CucumberOptions(features="resources/features", glue="StepDefinition")
public class Login {

}

【问题讨论】:

  • 提供堆栈跟踪和其他详细信息将有助于潜在的答案

标签: selenium selenium-webdriver automated-tests cucumber


【解决方案1】:

当您的项目中有 dependency mismatch 时会发生这种情况。更多细节可以在pom.xml中挖掘后看到。请分享。

现在您应该知道@Runwith takes something which extends ParentRunner Class,因此请确保您在此处使用的Cucumber.class 扩展了ParentRunner。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-28
    • 1970-01-01
    • 2019-08-30
    • 2019-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-19
    相关资源
    最近更新 更多