Call test case in Katalon Studio
When generating test steps in a test case in Katalon Studio, you can also call another test case as a test step. This section guides you through how to call a test case in manual and script view.
Note:
For more details on how to apply test cases in data-driven tests, refer to Test Case Variables.
Call test case in manual view
To call another test case in Manual view, do as follows:
Call test case in script view
callTestCase
method allows you to call another test case as a test step.Open a test case in script view, then refer to the following script:
import com.kms.katalon.core.model.FailureHandling
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
//Call test case using WebUI Class
WebUI.callTestCase(findTestCase("Test Case ID"), ["key1":"value1", "key2":"value2", … , "keyN":"valueN"], FailureHandling.OPTIONAL)
//Call test case using Mobile Class
Mobile.callTestCase(findTestCase("Test Case ID"), ["key1":"value1", "key2":"value2", … , "keyN":"valueN"], FailureHandling.OPTIONAL)
Items | Description |
---|---|
Test Case ID | The ID of the test case to be called. You can find this info in the test case properties. Learn more about test case properties here: View test artifact properties. |
Parameters binding:
| The list of input parameters for that test case, if any:
|
FailureHandling.option | The failure handling option for the current test step. This parameter is optional. See also: Failure Handling. |
Note:
To learn more about how to reuse test artifacts, refer to chapter 2 of our Katalon Academy course: Reusing Test Scripts.