NameMapping.CurrentConfigurationName Property

Applies to TestComplete 15.42, last modified on September 08, 2022

Description

Use the CurrentConfigurationName property to obtain the name of the current mapping configurations and to specify the current configuration by its name.

Declaration

NameMapping.CurrentConfigurationName

Read-Write Property String

Applies To

The property is applied to the following object:

Property Value

A string that specifies the configuration name.

Example

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.

JavaScript, JScript

function NameMappingSample()
{
  // Specifies the installed version of Internet Explorer
  var ver = Options.IESettings.GetInternetExplorerMajorVersion();

  // Sets the name mapping configuration
  if (ver > 7)
    NameMapping.CurrentConfigurationName = "IE8";
  else
    NameMapping.CurrentConfigurationName = "IE6&7";

  // Performs testing actions
  …

}

Python

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

VBScript

Sub NameMappingSample

  ' Specifies the installed version of Internet Explorer
  ver = Options.IESettings.GetInternetExplorerMajorVersion

  ' Sets the name mapping configuration
  If ver > 7 Then
    NameMapping.CurrentConfigurationName = "IE8"
  Else
    NameMapping.CurrentConfigurationName = "IE6&7"
  End If

  ' Performs testing actions
  …

End Sub

DelphiScript

procedure NameMappingSample();
var ver;
begin
  // Specifies the installed version of Internet Explorer
  ver := Options.IESettings.GetInternetExplorerMajorVersion;

  // Sets the name mapping configuration
  if (ver > 7) then
    NameMapping.CurrentConfigurationName := 'IE8'
  else
    NameMapping.CurrentConfigurationName := 'IE6&7';

  // Performs testing actions
  …

end;

C++Script, C#Script

function NameMappingSample()
{
  // Specifies the installed version of Internet Explorer
  var ver = Options.IESettings.GetInternetExplorerMajorVersion();

  // Sets the name mapping configuration
  if (ver > 7)
    NameMapping.CurrentConfigurationName = "IE8";
  else
    NameMapping.CurrentConfigurationName = "IE6&7";

  // Performs testing actions
  …

}

See Also

ConfigurationCount Property
ConfigurationNames Property
Name Mapping Configurations

Highlight search results