Validate Event

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

Occurs when the in-place editor needs to validate the new value.

Declaration

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

Description

When an in-place editor of a custom keyword test operation displayed in the Keyword Test editor is about to close and the HasChanges event handler reported that changes were made, the Validate event is then raised. When handled, it validates the new value. For example, if the in-place editor is supposed to accept numbers only, the Validate event handler should check if the inputted value corresponds to a number.

The default event handler used by TestComplete always returns True. You can create your own event handler to perform custom validation.

Parameters

The event has the following 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 value in the editor is valid; otherwise False.

Remarks

If the Validate event handler returned True, the ApplyChanges event then occurs in order for the operation to save the changes made via the in-place editor.

If the event handler returned False, the ValidationMessage event occurs to obtain the description of the validation error that has occurred.

See Also

Events Reference
StartEditing Event
GetEditValue Event
SetEditValue Event
HasChanges Event
ValidationMessage Event
ApplyChanges Event
Creating Keyword Test Operations

Highlight search results