OnSetup Event

Applies to TestComplete 15.46, last modified on January 09, 2023

Occurs when the operation needs to be set up.

Declaration

OnSetup(DataParameters) Parameters
Data [in] Required Object
Parameters [in] Optional Object
Result     Boolean  

Description

The OnSetup event handler occurs when the operation needs to be set up. This happens when the user does any of the following:

  • Adds the operation to the test.

  • Double-clicks the operation in the Keyword Test editor.

The event handler should provide a way for the user to specify the operation parameter values. For example, it could display a form where the user can input or choose the desired values.

If the operation has been successfully set up, the event handler should return True. Otherwise, it should return False.

Parameters

The event has the following parameters:

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.

Parameters

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

Note for VBScript users: If the operation does not have parameters, this argument must be absent in the event handler’s arguments list.

Return Value

True, if operation setup was successfull; otherwise False.

For example, if the OnSetup event handler displays a form that provides a visual interface to the operation properties, the routine could return True if the user closed that form via the OK button and False if the user clicked Cancel.

Remarks

If the operation’s OnSetup event handler returned True, the following takes place:

  • If the operation has parameters, TestComplete displays the Operation Parameters dialog that provides advanced options for specifying the parameter values.

  • The test is marked as modified.

If the OnSetup event was raised for a newly created operation to be added to the test and the event handler returned False, the operation is not added to the test.

See Also

Events Reference
OnCreate Event
OnExecute Event

Highlight search results