Call Test Case

For more details on how to apply test cases in Data-driven Testing, refer to Test Case Variables.

When generating test steps in a test case, you can also call another test case as a test step. This article guides you through how to call a test case in manual and script view.

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 option
  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 in manual view

    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 users to call another test case as a test step.

Open a test case in script view, then refer to the following syntaxes:

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:

[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.option The failure handling option for the current test step. This parameter is optional. See also: Failure Handling.

For example:

call test case in script view

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