NameMapping.ConfigurationCount Property

Applies to TestComplete 14.30, last modified on November 21, 2019

Description

Use this property to obtain the number of name mapping configurations.

Declaration

NameMapping.NamedChildCount

Read-Only Property Integer

Applies To

The property is applied to the following object:

Property Value

An integer value specifying the number of name mapping configurations.

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

NameMapping.ConfigurationNames Property
NameMapping.CurrentConfigurationName Property
Name Mapping Configurations

Highlight search results