OnExecute Event

Applies to TestComplete 15.42, last modified on August 01, 2022

Occurs when the operation is executed during the test run.


OnExecute(DataParam1Param2...) Parameters
Data [in] Required Object
Param1 [in] Optional Variant
Param2 [in] Optional Variant
Result     Variant  


The OnExecute event occurs when the operation is executed during the test run. The event handler should contain the code that the operation will execute.


The event has the following parameters:


An object that provides access to the operation fields. This object contains properties that correspond to individual operation fields and whose names coincide with the field names.

Param1, Param2, …, ParamN

Specify the operation parameters, in the same order as they are defined in the script extension’s description.xml file.

Return Value

If the operation is supposed to return a value, the OnExecute event handler must return this value, that is, it must be a function. Otherwise, the event handler must not return a value, that is, it must be a procedure.


If an operation can have child operations (for instance, it is a loop or conditional operation), the OnExecute event is triggered before executing child operations.

See Also

Events Reference
OnCreate Event
OnSetup Event
Creating Keyword Test Operations

Highlight search results