Name Property

Applies to TestComplete 15.20, last modified on January 19, 2022

The object-driven testing (ODT) functionality is deprecated. Do not use it to create new tests. It will be removed from the product in one of the future releases. As an alternative, you can create custom classes in your scripts. For more information, see Alternatives to the ODT functionality.

Description

Use the Group.Name property to get the name of the specified data group.

Declaration

GroupObj.Name

Read-Only Property String
GroupObj An expression, variable or parameter that specifies a reference to a Group object

Applies To

The property is applied to the following object:

Property Value

A string that holds the group name.

Example

The code below obtains the names of all the data groups existing in the current project and then posts these names to the test log.

JavaScript, JScript

function DataGroupCountExample()
{
  // Obtains the total number of groups
  var GroupNum = ODT.Data.GroupCount;
  
  // Iterates through the data groups
  for (var i = 0; i < GroupNum; i++)
  {
    var GrName = ODT.Data.Groups(i).Name;
    // Posts the name of the current group to the test log
    Log.Message(GrName);
  }
     
}

VBScript

Sub DataGroupCountExample

  ' Obtains the total number of groups
  GroupNum = ODT.Data.GroupCount
  
  ' Iterates through the data groups
  For i = 0 to (GroupNum - 1)
    GrName = ODT.Data.Groups(i).Name
    ' Posts the name of the current group to the test log
    Log.Message(GrName)
  Next 
     
End Sub

DelphiScript

function DataGroupCountExample;
var GroupNum, i, GrName;
begin

  // Obtains the total number of groups
  GroupNum := ODT.Data.GroupCount;
  
  // Iterates through the data groups
  for i := 0 to (GroupNum - 1) do
  begin
    GrName := ODT.Data.Groups[i].Name;
    // Posts the name of the current group to the test log
    Log.Message(GrName);
  end;
     
end;

C++Script, C#Script

function DataGroupCountExample()
{
  // Obtains the total number of groups
  var GroupNum = ODT["Data"]["GroupCount"];
  
  // Iterates through the data groups
  for (var i = 0; i < GroupNum; i++)
  {
    var GrName = ODT.Data["Groups"](i)["Name"];
    // Posts the name of the current group to the test log
    Log["Message"](GrName);
  }
     
}

See Also

Variables Property
AddGroup Method
DeleteGroup Method

Highlight search results