NameMapping.ConfigurationNames Property

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

Use the ConfigurationNames property to obtain the name of the mapping configuration by its index.

Declaration

NameMapping.ConfigurationNames(Index)

Read-Only Property String
Index [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

Index

Specifies the index of the desired name mapping configuration. The index is zero-based. Use the ConfigurationCount property to obtain the total number of mapping configurations.

Property Value

The name of the specified configuration.

Example

The following code snippet determines the number of name mapping configurations in the project and posts their names to the test log.

JavaScript, JScript

function NameMappingSample()
{
  // Determines the number of name mapping configurations  Count = NameMapping.ConfigurationCount;
  if (Count > 0)
  {
    Log.AppendFolder("The project contains the following name mapping configurations:");
    for (var i = 0; i < Count; i++)
      // Posts the configuration’s name to the test log
      Log.Message(NameMapping.ConfigurationNames(i));
    Log.PopLogFolder();
  }

}

Python

def NameMappingSample():
  # Determines the number of name mapping configurations  
  Count = NameMapping.ConfigurationCount;
  if Count > 0:
    Log.AppendFolder("The project contains the following name mapping configurations:")
    for i in range (0, Count):
      # Posts the configuration's name to the test log
      Log.Message(NameMapping.ConfigurationNames[i])
    Log.PopLogFolder()

VBScript

Sub NameMappingSample

  ' Determines the number of name mapping configurations
  Count = NameMapping.ConfigurationCount
  If Count > 0 Then
    Log.AppendFolder "The project contains the following name mapping configurations:"
    For i = 0 To Count - 1
      ' Posts the configuration’s name to the test log
      Log.Message NameMapping.ConfigurationNames(i)
    Next
    Log.PopLogFolder
  End If

End Sub

DelphiScript

procedure NameMappingSample();
var Count, i : integer;
begin
  // Determines the number of name mapping configurations  Count := NameMapping.ConfigurationCount;
  if Count > 0 then
  begin
    Log.AppendFolder('The project contains the following name mapping configurations:');
    for i := 0 to Count - 1 do
      // Posts the configuration’s name to the test log
      Log.Message(NameMapping.ConfigurationNames[i]);
    Log.PopLogFolder;
  end;

end;

C++Script, C#Script

function NameMappingSample()
{
  // Determines the number of name mapping configurations  Count = NameMapping["ConfigurationCount"];
  if (Count > 0)
  {
    Log["AppendFolder"]("The project contains the following name mapping configurations:");
    for (var i = 0; i < Count; i++)
      // Posts the configuration’s name to the test log
      Log["Message"](NameMapping["ConfigurationNames"](i));
    Log["PopLogFolder"]();
  }

}

See Also

ConfigurationCount Property
CurrentConfigurationName Property
Name Mapping Configurations

Highlight search results