BDD Testing - Unable to get past NoClassDefFoundError: TestObject error


Am trying out the new BDD cucumber feature. I’ve followed the sample feature file and step definition script available on The problem am facing is during execution of the feature file. It always errors out immediately after run with this error. Is anyone able to add feature files to an already Web testing project and run it successfully?



09-11-2018 10:41:36 AM - [START] - Start Test Case : Verification
09-11-2018 10:41:36 AM - [START] - Start action : runFeatureFile
09-11-2018 10:41:36 AM - [INFO] - Starting run keyword runFeatureFile: ‘Include/features/login.feature’ and extract report to folder: ‘C:\Users\jn6389\AppData\Local\Temp\Katalon\Include\features\login.feature\20180911_104133/cucumber_report/1536676896947’…
09-11-2018 10:41:37 AM - [FAILED] - Keyword runFeatureFile was failed (Root cause: java.lang.NoClassDefFoundError: TestObject)
09-11-2018 10:41:37 AM - [END] - End action : runFeatureFile
09-11-2018 10:41:37 AM - [FAILED] - Verification FAILED because (of) (Stack trace: com.kms.katalon.core.exception.StepFailedException: Keyword runFeatureFile was failed (Root cause: java.lang.NoClassDefFoundError: TestObject)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:56)
at com.kms.katalon.core.keyword.internal.KeywordMain$ Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:45)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile$0.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:95)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$ Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
at com.kms.katalon.core.main.WSVerificationExecutor.runScript(
at com.kms.katalon.core.main.WSVerificationExecutor.doExecute(
at com.kms.katalon.core.main.WSVerificationExecutor.processExecutionPhase(
at com.kms.katalon.core.main.WSVerificationExecutor.accessMainPhase(
at com.kms.katalon.core.main.WSVerificationExecutor.execute(
at com.kms.katalon.core.main.TestCaseMain.runFeatureFile(
at com.kms.katalon.core.main.TestCaseMain$runFeatureFile$ Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(
at groovy.ui.GroovyMain.processOnce(
at groovy.ui.GroovyMain.process(
at groovy.ui.GroovyMain.processArgs(
at groovy.ui.GroovyMain.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
09-11-2018 10:41:37 AM - [END] - End Test Case : Verification




Same problem here… :frowning: in my case was caused by Root cause: java.lang.NoClassDefFoundError: RequestObject instead of TestObject, funny because it works in my machine with exactly the same code and it doesn’t in my workmate machine.


Guys, please be aware, there is a new forum category for BDD:


Russ Thomas said:

Guys, please be aware, there is a new forum category for BDD:

Sorry Russ, but I’m not able to start any topic in there :frowning:


Really? Hmm… that’s a pain. I’ll drop them a line.


BDD Forum category should be fixed now.


I encountered the similar issue and resolved it.

See the following:


NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile time. After you compile your code, you end up with .class files for each class in your program. These binary files are the bytecode that Java interprets to execute your program. The NoClassDefFoundError indicates that the classloader (in this case, which is responsible for dynamically loading classes, cannot find the .class file for the class that you’re trying to use.

NoClassDefFoundError can occur for multiple reasons like

  • ClassNotFoundException – .class not found for that referenced class irrespective of whether it is available at compile time or not(i.e base/child class).
  • Class file located, but Exception raised while initializing static variables
  • Class file located, Exception raised while initializing static blocks