cucumber.runtime.CucumberException: Failed to inst

2019-06-13 17:19发布

问题:

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.

cucumber.runtime.CucumberException: Failed to instantiate class tests.SFDC.InsideSale.InsideSaleEndToEnd

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

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

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

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

回答1:

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.