Yes, you can call a custom a keyword inside another custom keyword. You simply just have to use the same syntax as you would normally use to call keyword.
Example code: start_app.StartAppKeyword:
package start_app
import com.kms.katalon.core.annotation.Keyword
class StartAppKeyword {
/**
* Refresh browser
*/
@Keyword
def startApplication() {
println "do something ...";
try {
throw new Exception("Somehow at this point an exception is thrown !");
} catch (Throwable e) {
CustomKeywords.'stop_app.StopAppKeyword.stopApplication'()
}
}
}
Try to import the needed (used) custom keyword class into the other one which is consuming it as a regular groovy/java class and use it accordingly (without Customkeyword.blah)
That should solve the ‘underline’ issue.
Have a feeling that katalon editor/intelisence engine it is now aware at the custom package level about the CustomKeyword wrapper therefore it may complain, even if the code it is compiled and running just fine
Not a big deal IMHO as long as the code it is correctly executed but it may be confusing.
But CustomKeywords.'xxx...xxx'() works only in a Test Case script. You should not call CustomKeywords.xxx…xxx() in a Groovy class under the Keywords directory.