When the Object Name Mapping dialog is in the Basic mode, you can specify mapping criteria for an application object as a set of identification properties and values. (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.
The Selected list (on the left) shows the current identification properties and values of a mapped object. By default, this list holds the default properties and values that TestComplete considers sufficient for object identification or, if there is a name mapping template that matches the current object, the properties defined in this template. The Available list (on the right) shows all the properties the object has (except for those specified in the Selected list). You can add and remove properties to and from an object’s mapping criteria by moving the properties between the lists using the arrow buttons.
The Available property list includes object properties that are provided by TestComplete and, if your tested application is Open, the object's native properties and fields. In general, it includes the same set of properties and fields that you see in the Object Browser or Object Spy when exploring an object, except for a few limitations that are described below.
The Available list does include:
Properties that return values of non-complex data types, like Boolean, integer, floating-point, string and others.
Properties that return objects (including empty objects).
The Available list does not include:
Properties of non-complex types that have an empty value (
nilin DelphiScript; do not confuse it with an empty string). This is because TestComplete needs to know the property type to use it when mapping objects.
Indexed properties (these are properties that require one or more additional parameters to get a value).
Protected and private properties and fields (unless the Show hidden members option is enabled in General Options).
Native object properties and fields that are unavailable to TestComplete (see Object Properties, Fields and Methods That Are Unavailable to TestComplete).
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 a property to mapping criteria
To add a new property to an object’s mapping criteria, select that property in the Available list and then click or double-click the property.
To add all the available properties to the mapping criteria, click .
Note: Properties that return an object (such properties are usually displayed as (Object) and have the ellipsis button) cannot be used in mapping criteria. However, properties of those returned objects can be used in mapping criteria. To add such a property to mapping criteria:
Click the ellipsis button in the object value cell to access the properties of that object.
Add the necessary properties to the mapping criteria as described above.
Once you add the desired properties, click to return to the list of properties of the original tested object.
It may take a lot of time for TestComplete to retrieve some property values (for instance, the
VisibleOnScreen property). Using such properties as a name mapping criterion may affect your test performance, especially if you use them when performing an extended search. We do not recommend that you use such properties when mapping objects.
To specify a value for an identification property
Select an identification property in the Selected list.
Click the ellipsis button in the property value cell.
In the resulting Edit Property Value dialog, specify the needed value. You can specify the property value as:
To remove a property from mapping criteria
To delete an identification property from mapping criteria, select that property in the Selected list and then click or double-click the property.
To delete all the properties from mapping criteria, click .
To quickly find a property in the list
Objects (especially in Open Applications) can have a lot of properties. To quickly find the needed property in the list, you can do any of the following:
Select any property name in the list, and then type the initial characters of the property name.
TestComplete will select the first property whose name starts with the typed characters.
– or –
Type the search text in the search box, or select one of the previously searched items from the list.
TestComplete will filter the property list to display only those properties whose names contain the search text.View imageView image
To remove the current filter, click the button in the search box or clear the search text.
To select a mapping template
Instead of setting identification properties manually, you can use a name mapping template for mapping. The template defines custom mapping criteria, that is, it helps you quickly set up multiple properties at once. To apply the template, click Templates, and then choose the needed template in the dialog:
The dialog lists all the mapping templates matching the object being mapped. If no templates are available, you can create a new one. See Create name mapping templates for details.
To enable or disable extended search criteria
If the object’s position in the application hierarchy may change, you can use extended search to map the object. Select the Find this node on any level of Name Mapping tree check box. TestComplete will be able to find the object in the application even if the object’s parents are not mapped. To learn more, see Name Mapping - Extended Search.
|Note:||You can also change this setting later in the Extended Find column of the Name Mapping repository.|
To highlight an object on screen
To quickly identify the object that is currently being mapped in the application, click Highlight. TestComplete will highlight the object with a flashing red frame on the desktop screen or in the Mobile Screen window.