Skip to main content

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:

  1. Open a test case in Manual view. Click on the dropdown icon of the Add button, then select Call Test Case.
    Call test case
  2. The Test Case Browser dialog appears. This dialog shows all existing test cases within the project. Select a test case to be called, then click OK. You can only call one test case at a time.
    Test case browser
  3. A Call Test Case step is now added with the selected test case above as its target.
    Call test case step
    Note:
    • Once a test step is added as Call Test Case, you cannot change it to another keyword.

Call test case in script view

In script view, the 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)
ItemsDescription
Test Case IDThe 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:

[key1:value1, key2:value2, … , keyN:valueN]

The list of input parameters for that test case, if any:

  • Key(s): The defined Test Case variables within the called test case.
  • Value: the value to be used for the corresponding public variables.
FailureHandling.optionThe failure handling option for the current test step. This parameter is optional. See also: Failure Handling.

Call test case in script view

Note:
  • To learn more about how to reuse test artifacts, refer to chapter 2 of our Katalon Academy course: Reusing Test Scripts.