0
votes

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
You need to give us more details here... What is the structure of your project? In particular, where is the tests.SFDC.InsideSale.InsideSaleEndToEnd class, and where does it get called? - Sébastien Le Callonnec
1) I have created StepsDefs(InsideSaleEndToEnd.java) created under "src/tests/SFDC/InsideSale. 2) I have created feature file under workspace/Project/Features/feauter*.feature. 3) I have created InsidesaleBase.java created under "src/tests/BaseClasses" 4) I have xml file which is calling InsideSale Base file and InsideSaleBase class has (@cucumberoptions(plugin = "json:target/cucumber-report.json", features="SFDC_Automation/features/featurefilename.feature", glue="classpath:tests.SFDC.StepDef") -- And my stepdefs designed as (public class InsideSaleEndToEnd extend 'class' implements 'class') - Umang
Never mind, Figured out my solution. File structure was wrong. Fixed it. Thanks! - Umang
Could you please give a bit mor details? I'm facing the same errormessage, and actually i don't see what's wrong with my system. - roli
You might give the wrong path of the property file . Please check - SC'

1 Answers

1
votes

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.