Events Reference

Applies to TestComplete 15.0, last modified on October 19, 2021

Custom keyword test operations created with script extensions raise various events during the test recording, test design and test run. These events are listed in the tables below. Your can subscribe to these events and handle them in order to customize the operation behavior in a variety of situations. The event handlers must be implemented in the script file that contains the operation implementation and must be defined in the description.xml file of the script extension package.

The following are events that occur in custom keyword test operations:

Event Description
CanExecuteBody The test engine triggers this event for conditional and loop operations to determine whether to run child operations.
IsSupported Occurs during test recording to check whether a particular piece of recorded script is equivalent to the operation.
OnCreate Occurs when a new operation instance is created.
OnExecute Occurs when the operation is executed during the test run.
OnGenerate Occurs when a new operation instance is recorded.
OnIterate This event is used for custom loop operations. It occurs at the end of each iteration and is used for updating internal counters and conditions.
OnSetup Occurs when the operation needs to be set up.

The following are common events of in-place editors used by the custom operations in the Keyword Test editor:

Event Description
ApplyChanges Occurs when the in-place editor is closed and the operation needs to save the changes made.
StartEditing Occurs when the in-place editor is activated.
GetEditValue Occurs when the in-place editor requests the value to display in the Keyword Test editor.
HasChanges Occurs when the in-place editor is closed, to check if the edit value has been modified.
SetEditValue Occurs when the value in the in-place editor is changed.
Validate Occurs when the in-place editor needs to validate the edit value.
ValidationMessage Occurs when TestComplete needs to know the last validation error that has occurred.

The following events are specific to in-place editors of the combo box type:

Event Description
AllowInputText Occurs when the combo box requests whether the users are allowed to input text in it.
GetCount Occurs when the combo box requests the number of its items.
GetItem Occurs when the combo box requests the item text.

The following events are specific for in-place editors with embedded buttons:

Event Description
GetButtonCount Occurs when the in-place editor requests the number of buttons to embed.
GetButtonImage Occurs when the in-place editor requests the image of a specific button.
OnButtonClick Occurs when the editor’s button is clicked.

The following event is specfic for the Parameters in-place editor.

Event Description
OnHelpCalled Occurs when the Help button in the Operation Parameters dialog is pressed.

See Also

Creating Keyword Test Operations

Highlight search results