Name Mapping Improvements in TestComplete 7
Name Mapping is TestCompletes feature that allows testers to separate the tested applications object names from tests in order to improve the maintainability of tests and make tests look cleaner. The recently released TestComplete 7 includes many improvements in the Name Mapping functionality to make it more robust and easier to use.
Automatic Name Mapping
TestComplete 7 has a new option to have tested objects mapped automatically while recording or editing a test. If you havent read the describing test recording improvements, be sure to check it out. Besides just recording automated tests, TestComplete automatically maps tested objects to custom names when you insert checkpoints for these objects in your automated tests. For those using keyword tests, TestComplete will also map objects as you add test operations that work with these objects.
This new feature can save you a lot of time, since it frees you from having to map the tested apps objects manually one-by-one. It is turned on by default and can be toggled on demand via the Tools | Options | Engines | Name Mapping | Map object names automatically option.
Merging Name Mapping Schemes
TestComplete 7 also allows you to import an external name mapping scheme into current projects with just a few clicks. Both schemes must have the exact same configuration set. The steps to merge name mapping files are very simple:
- Right-click the projects NameMapping item and select Merge with from the context menu:
Browse for the .tcNM file containing the name mapping scheme, and press Open.
Presto! The current projects name mappings are extended with those from the selected file, so you can start recording or writing new tests using these name maps right away. This allows testers to do name mapping simultaneously and then merge their partial mappings into one resulting scheme and also provides countless of other benefits.
Update Name Mapping during the Test Run
TestComplete now allows you to update your name mapping scheme during the test run if it finds that they are no longer valid. Whenever TestComplete detects that a name mapping item being referenced doesnt match any object, it displays a wizard where you can fix broken name mapping criteria or directly select the tested object to associate with the mapped name:
By default, the update mode is off but can be turned on using the Engines | Name Mapping | Automatically update name mapping items option. You would usually use the update mode to run tests against a new tested application build with modified GUI and interactively re-map changed objects.
Manage Mapped Objects Easier
Another notable improvement in TestComplete 7 is improved editing of name mapping schemes. You can now freely re-arrange items in the Mapped Object tree:
- You can drag-and-drop items (along with child items) anywhere within the Mapped Objects tree.
- You can also delete unnecessary name mapping items while having child items preserved. This is done using the Exclude command of the context menu:
These new edit types come in handy if developers have significantly modified the tested applications UI, for example, eliminated some containers (e.g. panels) from the UI or moved some controls to another container. In this case, you can simply drag-and-drop invalid mappings to the proper parent in the Mapped Objects tree or exclude unneeded mappings to make your Name Mapping scheme up-to-date.
Finding Mapped Objects Easier
What if you have already created a large name mapping scheme for the tested application, but developers are going to add object containers, such as panels, group boxes, etc., to make the UI more consistent?
Dont panic, your name map wont be broken by these new in-between containers, because TestComplete now has an option for handling this Extended Search. When this option is set on an individual name mapping item, it means that the underlying tested object may not be the direct child of the parent mapped object and there may be several intermediate objects between the parent object and this one. So, when identifying this tested object during test playback, TestComplete will search for this object not only within the parent container, but also within nested containers. This way, TestComplete will be able to successfully locate the object even if additional parent containers have been added.
To enable extended search of a mapped object from the Name Mapping editor:
- Add the Extended Find column to the Mapped Objects tree:
- Right-click somewhere within the Mapped Objects tree and select Field Chooser.
- Drag the Extended Find column onto the Mapped Objects tree header.
- Check the Extended Find checkbox for the desired mapped object:
To enable extended search while mapping an object:
- Check the Find this node on any level of NameMapping tree option in the Object Name Mapping dialog:
Map Objects by Child Objects
Last but not least, you can now map tested objects by their child objects. You will find this useful if you need to map a particular window to a custom name to distinguish it from a similar window. Heres how you can do this:
- Map the required children of the desired object.
- Select the object in the Mapped Objects or Aliases tree and switch to the Required Children tab in the pane on the right.
- Pick the child mapped objects that are required for the parent mapping to be valid:
Name Mapping improvements introduced in TestComplete 7 are aimed at making this feature more robust and flexible and at the same time easier to use and maintain. Be sure to download and try TestComplete 7 to see all of its new features, including enhanced Name Mapping, in action. And let us know what you think about the new version wed love to hear your feedback and are open to ideas that would help us make TestComplete even better!