Values Property

Applies to TestComplete 15.40, last modified on March 25, 2022

Description

Use the Values property to obtain or specify values stored in the Table project element that corresponds to the Table object.

Note: The Table object provides access to a copy of the stored data. So, changes made to stored values via the Values property only effect it during the test execution. The changes will not be applied to data stored in the Table project element and will not be displayed in the editor.

Declaration

TableObj.Values(aRow, aColumn)

Read-Write Property String
TableObj An expression, variable or parameter that specifies a reference to a Table object
aRow [in]    Required    Integer    
aColumn [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameters:

aRow

The row index of the desired value. This index coincides with the row position in the Table Element editor. The index is zero-based, that is, TestComplete considers that the first row has the index of 0, the second row has the index of 1 and so on. The total number of stored rows is specified by the RowCount property of the Table object.

aColumn

The column index of the desired value. This index coincides with the column position in the Table Element editor. The index is zero-based, that is, TestComplete considers that the first column has an index of 0, the second column has an index of 1 and so on.

To obtain the index of a column by the column name, use the ColumnIndex property of the Table object.

Property Value

Value of the specified stored cell.

Remarks

If you use Python or DelphiScript, you should enclose the parameters of the Values property in square brackets: Values[aRow, aColumn].

Example

The following example demonstrates how to change values stored in a Table element by using the Values property.

JavaScript

function Test()
{

  var Table, Value;
  // Obtains the Table object
  Table = Tables.OrdersTable;
  // Changes the value stored in the table
  Table.$set("Values", 5, 0, "New Cell Value");
  // Compares the modified table data with the data displayed by the control
  Table.Compare(true, lmError);

}

JScript

function Test()
{

  var Table, Value;
  // Obtains the Table object
  Table = Tables.OrdersTable;
  // Changes the value stored in the table
  Table.Values(5, 0) = "New Cell Value";
  // Compares the modified table data with the data displayed by the control
  Table.Compare(true, lmError);

}

Python

def Test():
  # Obtains the Table object
  Table = Tables.OrdersTable
  # Changes the value stored in the table
  Table.Values[5, 0] = "New Cell Value"
  # Compares the modified table data with the data displayed by the control
  Table.Compare(True, lmError)

VBScript

Sub Test

  Dim Table, Value
  ' Obtains the Table object
  Set Table = Tables.OrdersTable
  ' Changes the value stored in the table
  Table.Values(5, 0) = "New Cell Value"
  ' Compares the modified table data with the data displayed by the control
  Call Table.Compare(True, lmError)

End Sub

DelphiScript

procedure Test();
var Table, Value;
begin

  // Obtains the Table object
  Table := Tables.OrdersTable;
  // Changes the value stored in the table
  Table.Values[5, 0] := 'New Cell Value';
  // Compares the modified table data with the data displayed by the control
  Table.Compare(true, lmError);

end;

C++Script, C#Script

function Test()
{

  var Table, Value;
  // Obtains the Table object
  Table = Tables["OrdersTable"];
  // Changes the value stored in the table
  Table["Values"](5, 0) = "New Cell Value";
  // Compares the modified table data with the data displayed by the control
  Table["Compare"](true, lmError);

}

See Also

About Table Checkpoints
Modifying Table Elements
ValuesSelected Property
ColumnIndex Property
RowCount Property

Highlight search results