Compare Properties Operation

Applies to TestComplete 15.62, last modified on March 19, 2024

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

Specifies the value to test the property value against. The meaning of this parameter depends on the Condition parameter (see the table above).

CaseSensitive

If Value is a string, this parameter specifies whether the operation should perform a case-sensitive or case-insensitive comparison; otherwise, this parameter is ignored. By default, this parameter is True, which means the case-sensitive comparison; False means that the second case is ignored.

MessageType

Integer. Specifies the type of the message which the operation posts to the test log when the comparison fails. MessageType can take one of the following values:
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:

  1. Select the needed operation in your keyword test.

  2. Click the Value cell twice (not double-click) or select the cell and press F2. This will activate the in-place editor.

  3. Click the ellipsis button of the in-place editor. TestComplete will open the Operation Parameters dialog.

  4. In the dialog, specify the operation parameters. For detailed information on how to work with the dialog, see Specifying Operation Parameters.

  5. Click OK to close the dialog and apply changes.

  6. 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 and cmpNotContains 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 the cmpIn 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

Highlight search results