NodeDescription Property

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

The NodeDescription property is added to any object that is mapped with the Name Mapping feature.

Use this property to obtain the description of the mapped object.

Declaration

TestObj.NodeDescription

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

To all mapped processes, windows and controls.

View Mode

This property is not displayed in the Object Browser panel.

Property Value

A string holding the description of the name mapping object.

Example

The following example posts descriptions of the Sys mapped object and its child objects to the test log.

JavaScript, JScript

function NameMappingSample()
{
  var MappedObj, Desc, Item;
  // Obtains the Sys mapped object
  MappedObj = NameMapping.Sys;
  Log.AppendFolder(MappedObj.MappedName, MappedObj.NodeDescription);
  // Iterates through the child mapping items
  // Posts their names and descriptions to the test log
  for (var i = 0; i < MappedObj.NamedChildCount; i++)
  {
    Item = MappedObj.NamedChild(i);
    Log.Message(Item.MappedName, Item.NodeDescription);
  }
  Log.PopLogFolder();

}

Python

def NameMappingSample():
  # Obtains the Sys mapped object
  MappedObj = NameMapping.Sys
  Log.AppendFolder(MappedObj.MappedName, MappedObj.NodeDescription)
  # Iterates through the child mapping items
  # Posts their names and descriptions to the test log
  for i in range (0, MappedObj.NamedChildCount):
    Item = MappedObj.NamedChild[i]
    Log.Message(Item.MappedName, Item.NodeDescription)
  Log.PopLogFolder()

VBScript

Sub NameMappingSample

  ' Obtains the Sys mapped object
  Set MappedObj = NameMapping.Sys
  Call Log.AppendFolder(MappedObj.MappedName, MappedObj.NodeDescription)
  ' Iterates through the child mapping items
  ' Posts their names and descriptions to the test log
  For i = 0 To MappedObj.NamedChildCount - 1
    Set Item = MappedObj.NamedChild(i)
    Call Log.Message(Item.MappedName, Item.NodeDescription)
  Next
  Log.PopLogFolder

End Sub

DelphiScript

procedure NameMappingSample();
var
  MappedObj, Item : OleVariant;
  Desc : string;
  i : integer;
begin
  // Obtains the Sys mapped object
  MappedObj := NameMapping.Sys;
  Log.AppendFolder(MappedObj.MappedName, MappedObj.NodeDescription);
  // Iterates through the child mapping items
  // Posts their names and descriptions to the test log
  for i := 0 to MappedObj.NamedChildCount - 1 do
  begin
    Item := MappedObj.NamedChild[i];
    Log.Message(Item.MappedName, Item.NodeDescription);
  end;
  Log.PopLogFolder;

end;

C++Script, C#Script

function NameMappingSample()
{
  var MappedObj, Desc, Item;
  // Obtains the Sys mapped object
  MappedObj = NameMapping["Sys"];
  Log["AppendFolder"](MappedObj["MappedName"], MappedObj["NodeDescription"]);
  // Iterates through the child mapping items
  // Posts their names and descriptions to the test log
  for (var i = 0; i < MappedObj["NamedChildCount"]; i++)
  {
    Item = MappedObj["NamedChild"](i);
    Log["Message"](Item["MappedName"], Item["NodeDescription"]);
  }
  Log["PopLogFolder"]();

}

See Also

MappedName
Name Mapping
Name Mapping Editor
Add a Description for Mapped Objects

Highlight search results