Merging Name Mapping

When developing tests in a team, you can have several testers populate Name Mapping for different parts of your tested application simultaneously and then import the partial mappings into the “master” one for easier maintenance. You can then share the resulting Name Mapping file across all test projects developed for your application under test, or integrate external tests developed by individual testers into the “master” project.

Requirements
The Name Mapping files being merged must have the same set of configurations.

Name Mapping files created in previous versions of TestComplete (before 11) must be converted to the current version format before merging. To do this, open the project that contains the needed Name Mapping repository in TestComplete. TestComplete will ask you whether to convert the project suite to the current version of TestComplete. Click Yes. TestComplete will convert the project suite’s files, including the name mapping file, to the format supported by the current TestComplete version.

How to Merge
To merge an external Name Mapping file into your current project, do the following:

Right-click the Name Mapping project item in the Project Explorer panel and select Merge with from the context menu.

Browse for the external Name Mapping file whose data you want to import and press Open.

TestComplete adds the mapped objects and aliases from the selected file to the Name Mapping repository of your current project. The changes are made to the Name Mapping of the currently project only; the external Name Mapping file being imported is not changed.

How Merging Works

Merging Merging2 Merging3

Legend:

Green color : objects that were in both local and external Name Mapping files

Red color : objects from the local Name Mapping file

Blue color : objects from the external Name Mapping file

Conflict Resolving
A merging conflict occurs when two objects with the same name and in the same place in the local and external Name Mapping hierarchies have different mapping criteria. Typically, but not always, the conflicting mapped objects correspond to the same object in the tested application.

TestComplete resolves merging conflicts automatically. The result depends on whether the Name Mapping files were created separately (case #1 below), or the external Name Mapping file is a modified copy of the local Name Mapping file (case #2 below).

To understand how conflicts are resolved, see the Name Mapping files below. They have the same object hierarchy; the only difference is that the wndNotepad object in the external Name Mapping file has an extra property. This difference causes a conflict when merging the wndNotepad object.

Conflict Name Mapping1
Conflict Name Mapping 2

Case #1: The conflicting objects were added to both Name Mapping files separately. For example, the Name Mapping files are from different, separately created projects. Or if one Name Mapping file was created by coping another file, and the conflicting objects were mapped after copying.

In this case, the local and external objects are considered different objects, and the external object is imported with the _new suffix. Depending on the identification properties, both the original and _new objects in the resulting Name Mapping file may point to the same object in the application.

Case1

Case #2: The external Name Mapping file is a modified copy of the local Name Mapping file, and the conflicting object was mapped before copying.

In this case, the conflicting objects are merged into a single object with the following mapping criteria:

the mapping mode (basic or conditional), properties and property values of the local object,

the description (in the Mapped Objects tree) of the local object,

the Extended Find setting of the external object,

a combined Required Children set from both the local and external objects.

In our example, the wndNotepad objects being merged have different identification properties. According to the merging rules, the merged wndNotepad object gets the same identification properties as the original local wndNotepad object does.

Case2

TestComplete displays a message if there were conflicts during merging. You can then find the changed objects (for example, imported objects with the _new suffix), see if the resulting Name Mapping file suits your needs and correct it if needed.