ValuesSelected Property

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Use the ValuesSelected property to set whether the specified data cell will be used when comparing database values with 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 the ValuesSelected 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.ValuesSelected(aRowaColumn)

Read-Write Property Boolean
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

True, if the value will be used in comparison and False otherwise.

Remarks

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

Example

The following example demonstrates how to use the ValuesSelected property to specify what values in the table will not be used for the comparison.

JavaScript

function Test()
{

  var Table, RowCount, Column;
  // Obtains the Table element
  Table = Tables.OrdersTable;
  // Specifies the index of the column whose values will not be used in the comparison
  Column = 0;
  // Obtains the total number of rows in the table
  RowCount = Table.RowCount;
  // Iterates through the stored rows
  for (let i = 0; i < RowCount; i++)
    Table.$set("ValuesSelected", i, Column, false);
  // Compares the stored values
  Table.Compare(true, lmError);

}

JScript

function Test()
{

  var Table, RowCount, i, Column;
  // Obtains the Table element
  Table = Tables.OrdersTable;
  // Specifies the index of the column whose values will not be used in the comparison
  Column = 0;
  // Obtains the total number of rows in the table
  RowCount = Table.RowCount;
  // Iterates through the stored rows
  for (i = 0; i < RowCount; i++)
    Table.ValuesSelected(i, Column) = false;
  // Compares the stored values
  Table.Compare(true, lmError);

}

Python

def Test():
  # Obtains the Table element
  Table = Tables.OrdersTable
  # Specifies the index of the column whose values will not be used in the comparison
  Column = 0
  # Obtains the total number of rows in the table
  RowCount = Table.RowCount
  # Iterates through the stored rows
  for i in range(0, RowCount):
    Table.ValuesSelected[i, Column] = False
  # Compares the stored values
  Table.Compare(True, lmError)

VBScript

Sub Test

  Dim Table, RowCount, i, Column
  ' Obtains the Table element
  Set Table = Tables.OrdersTable
  ' Specifies the index of the column whose values will not be used in the comparison
  Column = 0
  ' Obtains the total number of rows in the table
  RowCount = Table.RowCount
  ' Iterates through the stored rows
  For i = 0 To RowCount - 1
    Table.ValuesSelected(i, Column) = False
  Next
  ' Compares the stored values
  Call Table.Compare(True, lmError)

End Sub

DelphiScript

procedure Test();
var Table, RowCount, i, Column;
begin

  // Obtains the Table element
  Table := Tables.OrdersTable;
  // Specifies the index of the column whose values will not be used in the comparison
  Column := 0;
  // Obtains the total number of rows in the table
  RowCount := Table.RowCount;
  // Iterates through the stored rows
  for i := 0 to RowCount - 1 do
    Table.ValuesSelected[i, Column] := false;
  // Compares the stored values
  Table.Compare(true, lmError);

end;

C++Script, C#Script

function Test()
{

  var Table, RowCount, i, Column;
  // Obtains the Table element
  Table = Tables["OrdersTable"];
  // Specifies the index of the column whose values will not be used in the comparison
  Column = 0;
  // Obtains the total number of rows in the table
  RowCount = Table["RowCount"];
  // Iterates through the stored rows
  for (i = 0; i < RowCount; i++)
    Table["ValuesSelected"](i, Column) = false;
  // Compares the stored values
  Table["Compare"](true, lmError);

}

See Also

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

Highlight search results