Name Mapping - Basic Mapping Criteria

Applies to TestComplete 15.70, last modified on December 17, 2024

The Name Mapping repository stores all your tested objects with identification criteria that TestComplete uses to find the objects in applications. By default, TestComplete uses one or more property-value pairs to identify the objects:

An object recognized by its properties

Click the image to enlarge it.

Note: Identifying objects by a collection of property-value pairs is supported for desktop applications and mobile applications running on devices connected to TestComplete locally. To identify objects in web applications and mobile applications running in device clouds, selectors are used. See Name Mapping - Selectors.

Usually, when mapping objects, TestComplete tries to choose the properties that will identify the objects in the application uniquely. However, there can be situations where you may want to add extra properties to the identification criteria or to remove unnecessary properties. You can also change the property values, for example, to match changes in your tested application.

Adding identification properties

Before adding identification properties to a mapped object, make sure your tested application is running and the object currently exists in it.

  1. Locate the object in the Name Mapping repository.

  2. Double-click the object. TestComplete will open the Edit Name Mapping Item dialog that lists all the properties used to identify the object:

    Edit Name Mapping Item dialog

    Click the image to enlarge it.

  3. In the Available list on the right, select the property you want to add and click .

    You can set a property value using:

    To add a nested property (for example, NativeClrObject.Name):

    1. Select the first item (in our example - NativeClrObject) in the Available list on the right and click the ellipsis button in the property value cell.

    2. Select the second item (in our example - Name) and click .

  4. Add more properties, if needed.

  5. Click OK.

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.

Removing identification properties

  1. Select an object in the Name Mapping repository. You will see the object’s identification properties on the right.

  2. Right-click the property you want to delete and then click Delete.

Modifying property values

  1. Select an object in the Name Mapping repository. It will show the identification properties on the right.

  2. Select a property, press F2 and then click the ellipsis button in the property value cell. The Edit Property Value dialog will appear:

    Edit Property Value dialog
  3. In the dialog, specify a new property value:

    To use a constant value:

    1. Select Constant from the Mode drop-down list.

    2. Enter the property value in the Value text box.

      Tip: You can use wildcards (* and ?) or regular expressions to mask the dynamic parts of string values. For example, instead of Afx:TabWnd:3f9f0000:8:10005:10, use Afx:TabWnd:*.

    To use a project variable as the property value:

    1. Select Project Variable from the Mode drop-down list.

      Note: For project or project suite variables of the String, Integer, Boolean, and Double type, the list shows the current variable value making the choice easier.

    2. Select a variable from the Type list. The variable value will be shown in the Value box.

      Note: Only String, Integer, Double and Boolean variables can be used as identification property values.

    TestComplete caches mapped objects. If the variable value is updated during the test run, TestComplete may not update the mapped object’s criteria, and your test will continue using the cached object. To avoid possible issues, add the RefreshMappingInfo method to your test to command TestComplete to clear the cache and search for the object with the updated mapping criteria.

  4. Click OK.

See Also

Name Mapping
Name Mapping
Name Mapping - Conditional Mapping Criteria

Highlight search results