0 Shares 2408 Views 2 Comments

Name Mapping & Aliases

Mar 25, 2013
2408 Views 2

NameMappingName Mapping is the most important and exciting feature of test complete, Using this feature you can create a mapped name using the properties of the object in our application, which can then used to refer the object in the scripts. You must be wondering like, why we need this name mapping when TestComplete already lets us identify an object uniquely by object name format. Well… the problem is, object name depends on the object properties which is not consistent and can change from one application to another. Another problem is, the object names are quite long and not easily readable. At the same time it is very confusing to get the context of a particular statement.

Applications in the Windows system, subordinate to the application form, form controls are objects, each object has a unique identifier , they work together to build a huge object tree, the root node is Sys, can imagine a decked out hexadecimal number of the leaves of the tree, every leaf Properties Methods Events decorate it, if the recorded code hexadecimal numbers do object name all will collapse, so we must first of these objects a name, the most simple ideas is to use this object similar to the caption, index and classname attributes to a name, so TestComplete memory each object from the name, in order to clearly show the hierarchical relationship of the individual objects, use the fullname to identify. The Full Name looks probably like this:

Referring objects here is little dizzy, isn’t it …? , its very long and is not easy to write and read. To Solve this issue, TestComplete provides Name Mapping using which we can refer objects  and unique names. The statement will become readable.

Using the selected properties, Test Complete identifies the object using the properties and assigns a Mapped name to that object.

While creating a mapped name you need to provide a reasonable name for mapped name and select few unique identifiers for the object.

After creating Name Mapping for every object, we can refer to the object as follows.

It’s clear that this is easier to read. Even though it is easy to read, still the name is too long. It will be difficult to remember all the Mapped names and their hierarchy. So you end up getting the full mapped name of the object by using the object spy. As a result productivity goes down because you have to go through several steps to pick out the name.

To resolve this problem, we can use Alias names. From the above mentioned mapped name, we can remove a few objects and create a short name. For example the Aliases name of the above object can be given as follows.

This becomes very easy to read and write. Also we can easily memorize the names of required objects alone and type them in our scripts (without the help of the object spy).

To Map an object

Click on ‘Map Object From Screen’ button in TestComplete toolbar. alternatively you can select map object from Object browser right click menu.

 tc_NP_MapButton

 

This opens Map Object window. Drag the Finder tool to the Object you want to add and release the mouse button. Click OK Once done.

 tc_NM_MapObject

In the next screen it asks to map all the parent objects. Click Yes.

tc-nm_mapall

Map all the required objects with a readable and clear name until you get your object.

tc_nm_add details

When all the object is mapped open Name Mapping Item. this reveals the name mapping which you just created. You can see the Mapped Objects in a tree format. You will also see the Alias names which are created by default (in the same hierarchy as the Name Mapping).

tc_nm_bothsame

If you use this default Aliases name, it will come to the same length as Full Mapped name. Remove the names of some unwanted higher level objects by dragging the objects into aliases under the required object hierarchy.

tc_nm_draggedinaliases

 

You may be interested

Setting up Web Service Automation Project
Katalon Studio
240 views
Katalon Studio
240 views

Setting up Web Service Automation Project

Saket - Oct 24, 2017

Web services are specific services that can be published and called over the Internet by client applications. Katalon Studio supports functional testing of web services. This topic…

Setting up Mobile Automation Project in MacOS
Katalon Studio
241 views1
Katalon Studio
241 views1

Setting up Mobile Automation Project in MacOS

Saket - Oct 09, 2017

Using Katalon Studio, mobile tester can design automation test for both Android and iOS to run on physical devices, cloud services and emulators. This tutorial explains how…

UFT Jenkins Integration
Unified Functional Testing
795 views
Unified Functional Testing
795 views

UFT Jenkins Integration

Saket - Oct 03, 2017

In our earlier post, we got to know the easy integration of UFT with GIT. This post focuses on integration of UFT and Jenkins. I have also…

2 Comments

  1. Pingback: Automated -360 | Create your first test with TestComplete

  2. Pingback: Extended Find mechanism of NameMapping in TestComplete - Automated360

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...