NameMapping object provides a program interface to the objects specified via their custom names that were assigned to them in the current TestComplete project. See Name Mapping. The child objects of
NameMapping are the objects with custom names, that are also called name mapping items. They are organized in the same manner as the name mapping items in the Adding Objects to the Name Mapping Repository topic. To obtain an item from a script, you should use the following notation:
NameMapping.MappedName, where MappedName is the custom name assigned to the object.
NameMapping object is only available if your project contains the Name Mapping project item.
The following code snippet determines what version of Internet Explorer is installed on the current computer and, depending on the version, sets the name mapping configuration.
def NameMappingSample(): # Specifies the installed version of Internet Explorer ver = Options.IESettings.GetInternetExplorerMajorVersion() # Sets the name mapping configuration if ver > 7: NameMapping.CurrentConfigurationName = "IE8" else: NameMapping.CurrentConfigurationName = "IE6&7" # Performs testing actions