I use KS version 7.2.1 on Windows 10.
I made a Test case named “caller”:
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
def USERNAME = "foo"
def PASSWORD = "bar"
WebUI.callTestCase(findTestCase("callee"),
["username": USERNAME, "password": PASSWORD])
I made another Test Case named “callee”:
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
WebUI.comment("username is " + username)
WebUI.comment("password is " + password)
When I ran the caller, it worked fine with message:
2020-05-06 13:43:54.326 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2020-05-06 13:43:54.329 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/caller
2020-05-06 13:43:54.790 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2020-05-06 13:43:54.790 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/callee
2020-05-06 13:43:54.796 INFO c.k.katalon.core.main.TestCaseExecutor - username = foo
2020-05-06 13:43:54.850 INFO c.k.k.c.keyword.builtin.CommentKeyword - username is foo
2020-05-06 13:43:54.855 INFO c.k.k.c.keyword.builtin.CommentKeyword - password is bar
2020-05-06 13:43:54.857 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/callee
2020-05-06 13:43:54.857 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2020-05-06 13:43:54.867 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/caller
These are performing OK. But what I want to note is …
The parameters in the callee script (username
and password
) are displayed underlined. This underline confuses me. Usually IDE presents a variable name with underline to tell us that the variable is undefined; error is here, you should fix it.
In the above example the variable username
and password
are regarded valid by Katalon, therefore the test runs OK. But Katalon displays these 2 variables with underline, indicating these are NOT properly declared. Katalon looks inconsistent.
I am afraid that beginners would find this inconsistency hard to understand.