Use the Compare Properties operation to verify the property value of an object in the tested application. When you add this operation to your keyword test, TestComplete shows a dialog that helps you specify the parameters needed for the operation. To modify the specified parameters, double-click the operation in the Keyword Test editor.
If the comparison procedure satisfies the specified conditions, the operation returns True and posts an informative message () to the test log. Otherwise, the operation returns False and posts a message corresponding to the operation's MessageType parameter to the log.
The operation is an analog to the
aqObject.CompareProperty scripting method.
The operation cannot have child operations.
The operation uses the following parameters:
The name of the object and its property to be checked.
If the property with the given name is not found, an error occurs. Use the
aqObject.IsSupported method to verify whether the object has a specific property.
Specifies the condition that will be used to compare a property value with the Value parameter.
When testing a property value of a string type, you can use any of these conditions. For more information about string comparison rules, see the Remarks section.
When you select the Matches and Not Matches conditions, the property value is compared with the regular expression specified by the Value parameter.
When testing a numeric property value, you can use any of the following conditions: Equals, Does not equal, Greater than, Less than, Greater than or equal to, Less than or equal to.
When testing a property that has a Boolean value, you can use only the Equals or Does not equal condition.
||Do not post any message.|
||Post an informative message.|
||Post a warning message.|
||Post an error message.|
For information on specifying the MessageType parameter value, see Specifying Enumeration Values in Parameters.
To modify the operation’s parameters:
Select the needed operation in your keyword test.
Click the Value cell twice (not double-click) or select the cell and press F2. This will activate the in-place editor.
Click the ellipsis button of the in-place editor. TestComplete will open the Operation Parameters dialog.
In the dialog, specify the operation parameters. For detailed information on how to work with the dialog, see Specifying Operation Parameters.
Click OK to close the dialog and apply changes.
Press Enter to confirm the changes and close the in-place editor, or press Esc to close the editor discarding any changes.
By default, if the Compare Properties operation cannot find or access the property to be compared, it waits for it for some period of time specified by the Auto-wait timeout setting (this setting belongs to the Playback group of your project’s properties). If the property has not been found by the end of the delay, the comparison fails.
You can use the
cmpNotContainsconditions to test a value against comma-separated, pipe-separated lists, and so on, that is, to check whether the value equals (or does not equal) to any value stored on the list. For example, you can use the
cmpIncondition to check whether the script selected in the Script box of the Notepad’s Font dialog equals to one of the values contained in the "Western|Central European" list.