Issue with @After hook for cucumber feature file

Hello,

I think there is an issue with latest version of Katalon.
I am using v5.10.1 and I use Cucumber feature.

I have created as Step definition, a class named Hook where I use a @After tag to reset my app:

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory
import com.kms.katalon.core.model.FailureHandling
import cucumber.api.java.Before
import cucumber.api.java.After
import internal.GlobalVariable

class Hooks {

/**

  • Hooks for feature files.
  • Reset application after the end of each scenario
    */

@After
def resetApp() {
My code
}

In my feature file I have two scenari.
When the first scenario is finished, After tag is trying to be executed. and Scenario failed with java.lang.UnsupportedOperationException
If I remove this after tag, scenario is finished with Success.

This is the stacktrace:

runFeatureFile(“Include/features/Sliders.feature”) FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: Keyword runFeatureFile was failed (Root cause: java.lang.UnsupportedOperationException)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:32)
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$runKeyword.call(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:46)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile$0.callStatic(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:101)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile.call(Unknown Source)
at Slider Runner.run(Slider Runner:3)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:149)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1546952361719.run(TempTestSuite1546952361719.groovy:36)

It was correctly working with version 5.8.6. I have upgraded from 5.8.6 to 5.10.1 and does not work anymore.
I cannot find anything talking about some changes on this behavior on release notes.

1 Like

I am having the exact same issue using @Before

@Alice please take a look.

Hello,

Any news on this issue? could we expect a fix soon or should I use an old Katalon IDE version?

Up … I have same issue, Any update guys ?

I am having same isue

Hi @quentin, @brian.mcleod, @ibnu.hazar

Please let us know if the Katalon Studio v6.0.5 has resolved this issue.

Hello,

Yes thank you, issue is solved in 6.0.5!

1 Like

i don’t konw how to use after step in feature , can you share the detail , thanks.