Creating Keyword Test Operations

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

The script extension technology allows you to create custom operations for use in keyword tests. These operations can be implemented to perform any actions that your needs dictate. For example, they could provide custom checkpoint types, serve as wrappers for frequently used scripting methods, perform some common tasks and other useful functions.

Custom operations are added to the Operations palette of the Keyword Test editor next to standard operations:

Custom keyword test operation in the Operations palette

In script extensions, a keyword test operation is implemented as a set of script routines. The main routine is executed when the operation is executed. Other routines are helpers and are used for initializing the operation parameters, handling various events that occur during operation editing, and so on. To let TestComplete know about operations that a script extension provides, about operation parameters and routines executed by operations, each operation must be defined in the description.xml file of the extension’s package. The definition includes the operation name, category, parameters, the name of the underlying script routine and other helper routines. For details, see Structure of the Description File.

In this section:

Creating Keyword Test Operations - Basic Concepts

Provides general information about creating custom keyword test operations and writing the operation code.

Creating Operation Parameters and Fields

Provides information about operation parameters and internal fields and explains how to create them and use them in the operation code.

Writing Operation Code

Explains how to write the script code that will be executed by the operation during the test run.

Creating Operation Initialization Routine

Explains how to write script code that initializes the operation’s parameter and field values.

Creating the Operation Setup Routine

Explains how to create a form that provides visual access to the operation parameters and to display this form upon user request.

Customizing KeywordTest Editor Contents

Explains how to specify the operation data to be displayed in the Keyword Test editor.

Implementing In-Place Editing Support

Explains how you can enable in-place editing of operation data displayed in the Keyword Test editor.

Implementing Recording Support

Explains how you can create operations that can be recorded.

Creating Conditional, Loop and Group Operations

Describes how to create operations that group child operations, execute them according to certain conditions or run them in a loop.

Events Reference

Provides information about events that occur in keyword test operations.
Related Topics of Interest

Using Forms in Script Extensions

Explains how you can create forms that can be used to set up properties of keyword test operation.

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 Log Attributes operation that was created with the script extension technology. This operation is 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 operation’s source code. The operation code is located in the laCode.js file, the operation definition - in the description.xml file.

There is a tutorial that describes the creation of the Log Attributes operation:

Creating Keyword Test Operations Tutorial

See Also

Script Extensions
Creating Script Extensions
Creating Custom Actions
Creating Runtime Objects

Highlight search results