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:
In scripts, property checkpoints are performed using the
Call aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, "wItem(5, 0)", cmpContains, "Mark Twain")
aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, "wItem(5, 0)", cmpContains, "Mark Twain");
aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, "wItem(5, 0)", cmpContains, "Mark Twain")
aqObject.CheckProperty(Aliases.Orders.MainForm.OrdersView, 'wItem(5, 0)', cmpContains, 'Mark Twain');
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.
Note that 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. To verify such properties, 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. TestComplete provides the Property Checkpoint wizard that assists you in creating and configuring property checkpoints. For detailed instructions on using the wizard, see Creating Property Checkpoints.
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 Additional Info 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
else branches, respectively.
Property Checkpoint Alternatives
In addition to property checkpoints for property verification, you can use one of the following approaches:
To verify multiple object properties at once, use object checkpoints.
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.
TestComplete includes sample test projects (one per each supported scripting language) that demonstrate how to use property checkpoints in tests: