本文介绍了黄瓜.runtime.CucumberException:无法实例化类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的黄瓜基类.

@CucumberOptions(plugin = "json:target/cucumber-report.json", features="SFDC_Automation/features/featurefilename.feature",glue="classpath:tests.SFDC.StepDef")公共类 InsideSaleTest 扩展 AbstractTestNGCucumberTests {}

运行这个基类后,我看到以下异常.

cucumber.runtime.CucumberException: 无法实例化类 tests.SFDC.InsideSale.InsideSaleEndToEnd

================================================

InsideSaleEndToEndTesting
运行的测试总数:1,失败:1,跳过:0

================================================

有人可以帮我解决这个问题吗?非常感谢!

解决方案

我假设您的类文件 InsideSaleEndToEndTesting 包含 JUnit 的注释以及粘合代码/函数.因此,当 Cucumber 尝试创建 InsideSaleEndToEndTesting 的实例时,它抛出了这些异常.

Here is my cucumber base class.

@CucumberOptions(plugin = "json:target/cucumber-report.json", features="SFDC_Automation/features/featurefilename.feature", glue="classpath:tests.SFDC.StepDef")
public class InsideSaleTest extends AbstractTestNGCucumberTests {
}

And after running this base class, I am seeing following exception.

===============================================

InsideSaleEndToEndTesting
Total tests run: 1, Failures: 1, Skips: 0

===============================================

Can some please help me resolve this issue? thanks a ton!

解决方案

I assume that your class file InsideSaleEndToEndTesting was containing annotations of JUnit and also glue codes/functions. Hence when cucumber tried to create a instance of InsideSaleEndToEndTesting, it had thrown these exceptions.

这篇关于黄瓜.runtime.CucumberException:无法实例化类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 12:47