CanExecuteBody Event

Applies to TestComplete 15.47, last modified on January 20, 2023

Occurs during execution of conditional and iterator operations to check whether the test engine should execute child operations.

Declaration

CanExecuteBody(Data) Parameters
Data [in] Required Object
Result     Boolean  

Description

Loop and conditional keyword-test operations have one or more child operations that can be executed in a loop or according to the operation’s condition. Operation developers use the CanExecuteBody event handler to control whether the test engine should execute child operations. If the CanExecuteBody event handler returns True, the test engine executes child operations. If the event handler returns False, the test engine does not execute child operations.

Parameters

The event has one parameter:

Data

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.

Return Value

True if the test engine should execute child operations, False otherwise.

Remarks

  • For conditional operations, the CanExecuteBody event is triggered after the OnExecute event, that is, the sequence of events at run time is as follows:

    OnExecute

    CanExecuteBody

    Run child operations…

  • For loop operations, the CanExecuteBody event is triggered at the beginning of each iteration, before the OnIterate event, that is, the sequence of events at run time is as follows:

    OnExecute (triggered only once, before the first iteration)

    CanExecuteBody (on each iteration)

    Run child operations…

    OnIterate

See Also

Events Reference
OnIterate Event
OnExecute Event
Creating Keyword Test Operations

Highlight search results