Creating Custom Actions

Applies to TestComplete 14.93, last modified on October 12, 2021

You can use script extensions to create new actions (commands) that will be added to TestComplete toolbars during test recording and design-time. These actions can assist you in creating tests. For example, they can create custom checkpoints and generate the corresponding verification code for you, display test creation tutorials, and perform many other useful operations.

Custom actions are added to TestComplete toolbars next to standard commands. Record-time actions are added to the Recording toolbar:

design-time actions -- to the Tools toolbar:

The actions are implemented as script routines, which are executed when the user clicks the action button on the toolbar. To let TestComplete know which actions an extension provides and which script routines they execute, actions are defined in the description file of the extension’s package. The definition includes the action name, type (record-time or design-time) and the name of the underlying script routine (see Structure of the Description File for details).

The topics in this section provide detailed information about creating custom actions:

Creating Actions - Basic Concepts

Provides general information about creating custom actions and writing the action code.

Writing Action Code

Describes how to write the routine that will be executed by the action.

Adding Files to Stores

Explains how actions can save files, objects and images in the project’s Stores collections.

Generating Script Code

Provides an overview of the TestComplete syntax subsystem, which is responsible for generating code statements in scripting languages supported by TestComplete, and explains how you can use it to generate script code.

Working With the Code Editor

Explains how design-time actions can access and modify the script code displayed in the Code Editor.
Related Topics of Interest

Using Forms in Script Extensions

Explains how the actions can use forms to interact with the user.

Handling Errors in Script Extensions

Discusses various aspects of exception handling in script extensions.

Structure of the Description File

Describes XML elements of the description file that is used to provide information about script extensions.
Samples and Tutorials

TestComplete includes the clipboard and manual checkpoints that are created with the script extension technology. These checkpoints are provided by the AQAScriptExtensions.tcx package that is located in the <TestComplete>\Bin\Extensions\ScriptExtensions folder. This extension package is a ZIP archive, so you can unpack it and thus view the source code of the  Clipboard Checkpoint and  Manual Checkpoint commands. The source code of the commands are located in the clcCode.js and mncCode.js files respectively, the commands’ definition - in the description.xml file.

Implementation of clipboard checkpoints is described in the following tutorial:

Creating Actions Tutorial

See Also

Script Extensions
Creating Script Extensions
Creating Runtime Objects
Creating Keyword Test Operations

Highlight search results