Here I assume that you are a well-trained programmer and use the Script mode of Test Case editor in Katalon Studio; you rarely use Manual mode.
You can create a new test case "Test Cases/TC1"
where you have a single line of Groovy script:
println CustomKeywords.'test.common.TimeHelper.getServerTimestamp'('yyyyMMdd000000', 1, 0)
You can write another test case "Test Cases/TC2"
in the Script mode as the following:
import test.common.TimeHelper
println TimeHelper.getServerTimestamp('yyyyMMdd000000', 1, 0)
TC2 is also valid, it will work.
I want you to note:
- The
"CustomKeyword.xxxxxx"
notation was introduced for the Manual mode of Test Case editor. The Test Case editor is designed to show a dropdown list: and this GUI design is expressed as the format of"CustomKeyword.xxxxx"
in the Script mode. This is the only reason why Katalon Studio employs that notation. - If you do not use Manual mode GUI, you do not have to use
"CustomKeyword.xxxxxx"
notation in test cases at all. - In *.groovy files under the
Keywords
folder, you would be tempted to write@Keyword
annotation. The@Keyword
annotation informs KS Manual mode so that the annotated class/method is to be included in the GUI dropdown list; this is the only reason why@Keyword
annotation is there. Again, if you do not use the Manual mode, then you do not need the@Keyword
annotation at all.