MappedName Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Each object has a unique name among its siblings. For instance, there are no two processes with an identical name in the system. Likewise, a process cannot create two windows with an identical name. Using the TestComplete Name Mapping feature the unique name of the object (Name) can be mapped to another - custom name. The MappedName property returns the custom name of its object.

Declaration

TestObj.MappedName

Read-Only Property String
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

All processes, windows, controls and onscreen objects.

View Mode

To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Property Value

If testObjectObj is mapped but does not have an alias assigned, the MappedName property returns a string containing the object’s mapped name, which is used to refer this object via the NameMapping object. This string includes the object’s custom name along with the custom names of all its parent objects (starting from Sys). For example, NameMapping.Sys.Notepad.wndNotepad.

If the testObjectObj has an alias assigned, the MappedName property returns this a string containing the object’s alias, which can be used to refer this object via the Aliases object. For example, Aliases.wndWindow. At that, if the object has several aliases, the MappedName property returns a string containing the shortest of them.

If the testObjectObj is not mapped, the MappedName property returns an empty string.

Remarks

It may happen that two or more objects in the application have the same MappedName value. This happens if the object identification criteria associated with this mapped name are not unique and match several objects in the application.

If this is not indented logic of your name map, it is recommended that you modify the identification properties and values for mapped objects to ensure unique and unambiguous identification. This will help you avoid object identification problems when designing or running tests.

The MappedName property cannot be used as an identification property when creating name mapping templates. Otherwise, an error may occur.

Example

To view an example that demonstrates how to use the MappedName property, see Mapping Objects From Tests.

See Also

Name Mapping
Name Property
FullName Property
Id Property
ProcessName Property

Highlight search results