Name Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Use the Name property to obtain the name of the Table project element that corresponds to the Table object. This is the same name that is displayed in the Project Explorer panel.

Declaration

TableObj.Name

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

Applies To

The property is applied to the following object:

Property Value

String that specifies the element’s name.

Example

The following code snippet obtains the name and description of the Table element and posts them to the test log.

JavaScript, JScript

function Test()
{

  var Table, TableName, Description;
  // Obtains the Table object that corresponds to the Table element
  Table = Tables.OrdersTable;

  // Obtains the Table element’s name
  TableName = Table.Name;

  // Obtains the Table element description
  Description = Table.Description;

  // Posts the name and description to the test log
  Log.Message(TableName, Description);

}

Python

def Test():
  # Obtains the Table object that corresponds to the Table element
  Table = Tables.OrdersTable
  # Obtains the Table element's name
  TableName = Table.Name
  # Obtains the Table element description
  Description = Table.Description
  # Posts the name and description to the test log
  Log.Message(TableName, Description)

VBScript

Sub Test

  Dim Table, TableName, Description
  ' Obtains the Table object that corresponds to the Table element
  Set Table = Tables.OrdersTable

  ' Obtains the Table element’s name
  TableName = Table.Name

  ' Obtains the Table element description
  Description = Table.Description

  ' Posts the name and description to the test log
  Call Log.Message(TableName, Description)

End Sub

DelphiScript

procedure Test();
var Table, TableName, Description;
begin

  // Obtains the Table object that corresponds to the Table element
  Table := Tables.OrdersTable;

  // Obtains the Table element’s name
  TableName := Table.Name;

  // Obtains the Table element description
  Description := Table.Description;

  // Posts the name and description to the test log
  Log.Message(TableName, Description);

end;

C++Script, C#Script

function Test()
{

  var Table, TableName, Description;
  // Obtains the Table object that corresponds to the Table element
  Table = Tables["OrdersTable"];

  // Obtains the Table element’s name
  TableName = Table["Name"];

  // Obtains the Table element description
  Description = Table["Description"];

  // Posts the name and description to the test log
  Log["Message"](TableName, Description);

}

See Also

About Table Checkpoints
About Tables Collection
Description Property

Highlight search results