About Property Checkpoints

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

A property checkpoint is a test operation that verifies that an object property has the expected value in the tested application. For example, it verifies the text in a text box or the state of a check box. This helps you check whether your tested application works correctly.

In keyword tests, property checkpoints are performed using the Property Checkpoint operation:

Property checkpoint in a keyword test

In scripts, property checkpoints are performed using the aqObject.CheckProperty method:

JavaScript, JScript

aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, "wItem(5, 0)", cmpContains, "Mark Twain");

Python

aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, "wItem(5, 0)", cmpContains, "Mark Twain")

VBScript

Call aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, "wItem(5, 0)", cmpContains, "Mark Twain")

DelphiScript

aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, 'wItem(5, 0)', cmpContains, 'Mark Twain');

C++Script, C#Script

aqObject["CheckProperty"](Aliases["Orders"]["MainForm"]["OrdersView"], 'wItem(5, 0)', cmpContains, 'Mark Twain');

How a Property Checkpoint Works

When you run a test, TestComplete reads the current value of the specified property of the tested object (this object must exist in the application at that moment), compares it with the expected value and reports the result. Besides the "equals" check, property checkpoints let you perform "not equals", "greater than", "less than", "contains" and other kinds of checks. String values can be compared in case-sensitive and case-insensitive modes.

Property checkpoints can only be used for verifying simple values: strings, numbers, boolean values, dates and so on. They cannot check complex values, such as objects or arrays.

Note: If an object has a property or method that returns a DISPID_VALUE (for information on this, see DISPID Constants in the MSDN Library), the object is considered to have a value of a simple type and can be used for property validation. For example, a JavaScript array of simple values is an object with a string value (comma-separated list of items) and a .NET string is an object with a property returning the string contents.

To verify complex values, use one of the alternative approaches described below.

How to Create Property Checkpoints

You can add property checkpoints to your test during test recording and at design time. You can create property checkpoints by using the Create Checkpoint wizard, or you can create Quick Checkpoints. For detailed instructions, see Creating Property Checkpoints.

Checkpoint Results

During the test run, property checkpoints compare the actual and expected property values and post the comparison results to the test log. If the property values match, the checkpoint logs a success message; otherwise, it logs an error message. The Details panel displays the checkpoint parameters and the difference between the expected and actual property values (if any).

If you want to customize log messages of property checkpoints, use one of the alternative comparison approaches described below. For example, perform comparison using the if … then … else statement and comparison operators and post the success and failure log messages from the then and else branches, respectively.

Property Checkpoint Alternatives

In addition to property checkpoints for property verification, you can use one of the following approaches:

  • To compare the actual and expected property values, use the if … then … else statement and comparison operators such as =, >, >=, <, <= and so on. This way, you can implement custom verification logic and post custom success and failure messages to the test log.

  • Use the Compare Properties keyword test operation or the aqObject.CompareProperty scripting method. They are similar to property checkpoints, but they post less detailed output to the test log.

Updating Property Checkpoints

If a tested object whose property you want to verify has been modified in your application under test, your property checkpoint may fail. In order for the checkpoint to be passed successfully, update your checkpoint data. For information on how to do this, see Updating Property Checkpoints.

Samples

TestComplete includes a sample test project that demonstrates how to use property checkpoints in tests:

<TestComplete Samples>\Desktop\Checkpoints\Property

Note: If you do not have the sample, download the TestComplete Samples installation package from the https://support.smartbear.com/testcomplete/downloads/samples/ page of our website and run it.

See Also

Property Checkpoints
Property Checkpoint Operation
CheckProperty Method
Object Checkpoints

Highlight search results