Run Script Routine Operation

Applies to TestComplete 14.61, last modified on April 22, 2021

Description

Use the Run Script Routine operation to execute a script function from a keyword test. When adding the operation to your keyword test, you should specify the name of the routine to be called.

Requirements

In order to be able to add the operation to the test and run the operation successfully, the script units of your project must not contain syntax errors. Else, TestComplete may be unable to parse the script code and retrieve routine names.

Operation Result

The operation returns the same result as the script routine which it calls. For information on how to obtain the result value, see Checking Operation Result.

If the script routine does not return any value, the operation also does not return any value.

Scripting Analogue

This operation is a keyword test analogue for calling a script routine from another script routine.

Child Operations

The operation cannot have child operations.

Operation Parameters

When adding the operation to the keyword test, TestComplete displays the Select Test dialog, in which you can choose the script routine to be executed by the operation. If this routine has parameters, TestComplete then displays the Operation Parameters dialog in which you can specify the parameters’ values. If the routine has no parameters, the dialog is not shown.

After the operation was added to your keyword test, you can modify the parameters by double-clicking the operation’s row in the Keyword Test editor. TestComplete will repeat the same steps as if you added the operation to the test: first it will display the dialog, in which you can choose the needed routine, and then the dialog, in which you can specify the routine’s parameters (if any).

You can also change the routine name and parameters in special dialogs.

To specify another routine:

  • Select the operation in the Keyword Test editor.

  • Click the Operation cell twice (not a double-click) or select the cell and press F2. This will activate the in-place editor.

  • In the editor, click the ellipsis button. The Select Test dialog will appear.

  • Choose the desired routine in the dialog and click OK to apply changes and to close the dialog.

  • Press Enter to confirm the change and to close the in-place editor. Press Esc to close the editor and discard the changes.

After choosing another routine, TestComplete will change the data of the Value column. If the routine, you chose, has parameters, you will have to specify them.

To change the routine’s parameters:

  • Select the operation in the Keyword Test editor.

  • Click the Value cell twice (not a double-click) or select the cell and press F2. This will activate the in-place editor.

  • In the editor, click the ellipsis button. TestComplete will display the Operation Parameters dialog.

  • Enter the desired parameter values into the dialog. For more information on settings values in this dialog, see Specifying Operation Parameters.

  • Click OK to apply changes and to close the dialog.

  • Press Enter to confirm the changes and to close the in-place editor. Press Esc to close the editor and discard the changes.

Note: TestComplete activates the in-place editor and displays the Operation Parameters dialog only if the selected script routine has parameters. Else, the editor cannot be activated and the dialog is not shown.

Remarks

You can also create the Run Script Routine operation from the Project Explorer and Code Explorer. To do this, drag the needed script unit from the Project Explorer or the needed script routine from the Code Explorer to the desired location in a keyword test that is open in the Keyword Test Editor.

Note: By default, the Code Explorer panel is hidden from TestComplete. To make the panel visible, select View > Select Panel from the TestComplete main menu, and then select Code Explorer in the resulting Select Panel dialog.

See Also

Test Actions Category
Specifying Operation Parameters
Checking Operation Result
Run Code Snippet Operation
Run Test Operation

Highlight search results