Check Method

Applies to TestComplete 15.69, last modified on November 13, 2024
Object checkpoints are deprecated. We do not recommend using them. Use property checkpoints instead.

Description

The Check method is a scripting analog of the Object Checkpoint operation. It verifies the specified object existing in your tested application against the baseline data stored in the project’s Stores | Objects collection.

If the object’s actual property values equal the stored property values, the method returns True. Otherwise, it returns False.

The Check method also lets you update the baseline data stored in the Stores | Objects collection during the test run. To do this, enable both the global Update objects option and the Update option of the corresponding object in the collection. In this case, the method updates the baseline data with the property values of the corresponding actual object and its child objects. After that, the Check method posts a message reporting that the checkpoint data has been updated and returns True.

Declaration

StoredObjectObj.Check(AObject)

StoredObjectObj An expression, variable or parameter that specifies a reference to a StoredObject object
AObject [in]    Required    A tested object    
Result Boolean

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

AObject

The tested object whose properties you want to compare with those of the object stored in the StoredObject element.

Result Value

In the comparison mode, if the comparison procedure reports that the property values of the actual objects and the baseline property values are equal, the method returns True and ports a checkpoint message () to the test log.

Otherwise, the method returns False and ports an error message () to the test log.

In the update mode, the method always returns True.

Remarks

By default, if the Check method cannot find or access the object to be compared, or the object does not match its baseline copy, the method will wait for the object to become accessible and for the comparison to complete successfully for the period the Tools > Current Project Properties > Playback > Auto-wait timeout setting specifies. If the method fails to access the object, or if the object does not match its baseline copy within this period, the comparison will fail.

To compare two objects or update the property collection stored in the Objects collection, you can also use the Objects.Compare method.

Example

The following example executes the object checkpoint MyProcess against the test object of the MyProcess.exe process. The example assumes that the Stores | Objects collection contains the MyProcess item with the checkpoint data.

JavaScript, JScript

Objects.MyProcess.Check(Sys.Process("MyProcess"));

Python

Objects.MyProcess.Check(Sys.Process("MyProcess"))

VBScript

Call Objects.MyProcess.Check(Sys.Process("MyProcess"))

DelphiScript

Objects.MyProcess.Check(Sys.Process('MyProcess'));

C++Script, C#Script

Objects["MyProcess"]["Check"](Sys["Process"]("MyProcess"));

See Also

About Object Checkpoints
Compare Method

Highlight search results