The TestComplete Namemap

April 11, 2023

When writing automated tests with TestComplete so much depends on Object Identification. If you can’t get that right then you may as well forget everything else. Get the identification of your objects right then you’re building a good solid foundation for the automation scritps you’re developing.

The key feature in TestComplete that supports your ojbect identification is the Namemap. A complicated little beast. Once mastered, will make all the difference to the reliability and maintainability of your scripts.

What is this Namemap though?

Well you can think of it as just a list of objects (web pages, buttons, text boxes, whatever) that you need your automation scripts need to interact with. It doesn’t just cover the WHICH objects. It’s also covers the HOW too. How TestComplete will find those objects.

In this video I walk you through the concepts and the functionality that will help you master this complicated little beast. Once you’ve grasped these concepts you’ll find it

You’ll see in this video that we list pick out the three key aspects that we need this Namemap for.

1. LIST OF OBJECTS

Ultimately this Namemap thing allows you to construct a list of objects that you need to interact with in your automated tests. Your system may have thousands of objects that TestComplete can identify. All you want though is a handful of those objects. The Namemap is your list of objects that you want to focus on.

2. NAMES

When you need to refer to an object in your scripts you need a ‘name’. You need a name for each object you want to work with. The name you need to use in your scripts when you want to reference, interact or inspect an object.

With TestComplete there’s three ways you can do that…

Sys.* – Everything running on your system
NameMap.* – TestCompletes cut down view of the objects you want to focus on
Alias.* – Your ‘friendly’ list of objects you need to focus on

As we discuss in the video you can think of this in terms of layers. Bottom layer is everything on your system. Middle layer is TestComplete’s cut down view of the system.

And the top layer is your neatly organised and named list of objects you want to reference, interact and inspect in your automation scripts.

3. IDENTIFICATION PROPERTIES

So we have a list. That list contains the names of all the objects we want to interact with. The question is … “how does TestComplete find those objects?"

Well we know that every object has some properties. Between you and Testcomplete you need to work out the best properties to identify that object reliably.

When youv’e decided on the best properties for each object you define then in the Namemaps ‘Properties’ panel. list, modify and update those properties here…

Like I said at the start …. get this right and it makes if far easier to get everything else right. In the next video I’ll take you through a few tips and tricks for dealing with the Namemap.