Skip to main content

Import Custom Keywords classes recursively in Katalon Studio

  • You have a Katalon Studio Enterprise license.

Hypothetically, you want to call a Custom Keyword within a Custom Keyword that is defined in another class. Check out the code below for a sample implementation.


package my.aimport com.kms.katalon.core.annotation.Keywordclass Greeting { @Keyword def greet(String someone) { return my.b.AI.sayHelloTo(someone) }}


package my.bclass AI { static def sayHelloTo(String someone) { return "Hello, ${someone}." }}


import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUIdef str = CustomKeywords.'my.a.Greeting.greet'("Drunda")WebUI.comment(">>> ${str}")

The TC1 ran fine:

Credit to kazurayam