ObjectName Property

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

The ObjectName property specifies the full name of the object or control, whose data will be compared with the data stored in the Table project element that corresponds to the Table object. By default, this is the name of the object, from which the data was retrieved when the element was created or updated (that is, the same string that is displayed in the Table object edit box of the Table Element editor).

The object specified by the ObjectName property is used when you perform the comparison with the Table.Compare method.

Declaration

TableObj.ObjectName

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 full name of the desired object.

Example

The following code snippet obtains the name of the object whose data will be compared with data stored in the Table element, posts the name to the test log and performs the comparison.

JavaScript, JScript

function Test()
{
  var Table, TableName, ObjectName;
  // Obtains the Table object
  Table = Tables.OrdersTable;
  // Obtains the Table element’s name
  TableName = Table.Name;
  // Obtains the name of the object whose data will be compared with data stored in the Table element
  ObjectName = Table.ObjectName;
  // Posts the Table element’s name and the object’s name to the test log
  Log.Message("The " + TableName + " element will be compared with the " + ObjectName + " object.");
  // Performs the comparison
  Table.Compare(true, lmError);

}

Python

def Test():
  # Obtains the Table object
  Table = Tables.OrdersTable
  # Obtains the Table element's name
  TableName = Table.Name
  # Obtains the name of the object whose data will be compared with data stored in the Table element
  ObjectName = Table.ObjectName
  # Posts the Table element's name and the object's name to the test log
  Log.Message("The " + str(TableName) + " element will be compared with the " + str(ObjectName) + " object.");
  # Performs the comparison
  Table.Compare(True, lmError)

VBScript

Sub Test

  Dim Table, TableName, ObjectName
  ' Obtains the Table object
  Set Table = Tables.OrdersTable
  ' Obtains the Table element’s name
  TableName = Table.Name
  ' Obtains the name of the object whose data will be compared with data stored in the Table element
  ObjectName = Table.ObjectName
  ' Posts the Table element’s name and the object’s name to the test log
  Log.Message("The " & TableName & " element will be compared with the " & ObjectName & " object.")
  ' Performs the comparison
  Call Table.Compare(True, lmError)

End Sub

DelphiScript

procedure Test();
var Table, TableName, ObjectName;
begin
  // Obtains the Table object
  Table := Tables.OrdersTable;
  // Obtains the Table element’s name
  TableName := Table.Name;
  // Obtains the name of the object whose data will be compared with data stored in the Table element
  ObjectName := Table.ObjectName;
  // Posts the Table element’s name and the object’s name to the test log
  Log.Message('The ' + TableName + ' element will be compared with the ' + ObjectName + ' object.');
  // Performs the comparison
  Table.Compare(true, lmError);

end;

C++Script, C#Script

function Test()
{
  var Table, TableName, ObjectName;
  // Obtains the Table object
  Table = Tables.OrdersTable;
  // Obtains the Table element’s name
  TableName = Table["Name"];
  // Obtains the name of the object whose data will be compared with data stored in the Table element
  ObjectName = Table["ObjectName"];
  // Posts the Table element’s name and the object’s name to the test log
  Log.Message("The " + TableName + " element will be compared with the " + ObjectName + " object.");
  // Performs the comparison
  Table["Compare"](true, lmError);

}

See Also

FullName Property
Compare Method

Highlight search results