在 Katalon Studio 中声明 CustomKeywords 的常规方式是什么?

What is the conventional way of declaring CustomKeywords in Katalon Studio?

我对如何在 Katalon Studio 中声明 CustomKeywords 有点困惑。它们是否应该像带有访问修饰符的普通方法一样声明,例如 public,例如:

@Keyword
public void loadApp(int delay){
//some code
}

或者它们应该用关键字 def:

声明
@Keyword
def loadApp(int delay){
//some code
}

我在 Katalon Studio 中还观察到的另一件事是,即使我在我的 CustomKeyword 中声明了一个私有方法,我也能够从我的测试用例中调用它,这与我的预期相反。我认为私有方法只能在我定义它的 CustomKeyword 中访问。

在Katalon Studio中,您需要使用@Keyword注解来告诉系统这是一个自定义关键字。

Public 或 Private 函数如果作为 Groovy 编程语言使用,将被计算在内。