How to Create or Delete a Script Routine

Applies to TestComplete 15.45, last modified on December 01, 2022

Using TestComplete you can create scripts in two ways: You can either record a script or write its code manually. There no difference between these scripts.

To create a new script routine, type its name in the Code Editor. For instance, type the following text to create a new MyProc script:

JavaScript, JScript

function MyProc()

Python

def MyProc()

VBScript

Sub MyProc

DelphiScript

procedure MyProc;

C++Script, C#Script

function MyProc()

The name of a new script is added automatically to the Code Explorer panel.

To learn how to record a new script, see Recording Automated Tests.

You can delete scripts by simply deleting their text in the Code Editor. You can also manage your scripts in the Code Explorer panel. You can delete the currently selected script in the Code Explorer by pressing Del or choosing Delete from the context menu. This will remove the script text from the unit source.

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

Recording Automated Tests

Highlight search results