When the Object Name Mapping dialog is in the Conditional mode, you can specify mapping criteria for an application object as conditional expressions. (You can switch the mapping modes in the bottom left corner of the dialog.)
The Mapped Name box holds the name that will be used to address the object in tests. TestComplete generates the name automatically based on the object’s type and text, native name or both. You can change the default name if needed (for example, you can specify a more descriptive name). Mapped object names can contain only letters (A..Z, a..z), digits (0..9) and underscore characters (_) and must start with a letter.
You can also describe the mapped object in the Description box.
An object’s mapping criteria is specified as one or more conditional expressions combined via the logical AND and OR operator. Each expression has the following structure:
Here, Property is the name of the object’s property, for example, WndClass. Value is either a constant, a project variable, or some other property of the same object to which Property belongs. Operator is a comparison operator, such as Equals or Greater than.
Once you have specified necessary mapping criteria for the object, click OK or Skip to close the dialog and map the object. Clicking OK will map the object and create an alias for it, while clicking Skip will map the object without creating an alias.
|Note:||You can manually define aliases for the mapped objects later in the Name Mapping repository. For more information, see Add Aliases.|
To close the dialog without mapping the object, click Cancel.
To add an expression to a condition
Select an expression in the table with which you want to combine the new expression.
Click the And or Or button, depending on the logical operator that you want to combine the expressions with.
In the newly added table row, specify the values being compared and the comparison operator.
To modify an expression
To change the property that is being compared, click the ellipsis button in the Property column and select the needed property in the Edit Property dialog.
To change the value with which the property is being compared, click the ellipsis button in the Value column and specify the needed value in the Edit Value dialog.
To change the comparison operator, select the needed operator from the Condition drop-down list. The following operators are available:
- Not equal
- Less than
- Less than or equal
- Greater than
- Greater than or equal
To delete an expression
To delete an expression from the condition, select it in the table and click Remove.
To delete all the expressions from the condition, click Remove All.
To enable or disable extended search criteria
If the parent hierarchy of the current object may change (for example, if intermediate objects are added), you can use extended search criteria to map the object. In this case, the object can be identified in the application even if the intermediate parent objects are not mapped. For more information on this, see Name Mapping - Extended Search.
To enable extended search criteria for the current object, select the Find this node on any level of NameMapping tree option.
To disable extended search criteria, clear the option.
|Note:||You can also change this setting later in the Extended Find column of the Name Mapping editor.|
To highlight an object on screen
To quickly identify the object that is currently being mapped in the application, click the Highlight button. TestComplete will activate the tested application for a while and point out the object by enclosing it in a flashing red frame.