Description
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.
Operation Result
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.
Scripting Analogue
The operation is an analog to the aqObject.CompareProperty
scripting method.
Child Operations
The operation cannot have child operations.
Operation Parameters
The operation uses the following parameters:
Property
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.
Condition
Specifies the condition that will be used to compare a property value with the Value parameter.
Notes:
-
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.
Value
CaseSensitive
MessageType
Constant | Value | Description |
---|---|---|
lmNone |
0 |
Do not post any message. |
lmMessage |
1 |
Post an informative message. |
lmWarning |
2 |
Post a warning message. |
lmError |
3 |
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.
Remarks
-
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
cmpIn
,cmpNotIn
,cmpContains
andcmpNotContains
conditions 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 thecmpIn
condition 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.
See Also
Checkpoints Category
Select Object Property Wizard
About Property Checkpoints
Specifying Operation Parameters
Checking Operation Result