Value Property

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

The Value property returns the value stored in the cell of the column which is specified by the Column parameter.

Declaration

LogTableRowObj.Value(Column)

Read-Only Property Variant
LogTableRowObj An expression, variable or parameter that specifies a reference to a LogTableRow object
Column [in]    Required    A LogColumn object    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

Column

A LogColumn object represents the column holding the desired cell.

Property Value

The value stored in the specified cell. It can be an integer or a floating-point number, a string, a boolean, a date-time value, a hyperlink or an image.

Note: To determine the type of values in the table column, you can use the LogColumn.DataType property.

Remarks

If you use Python or DelphiScript, you should enclose the parameter of the Value property in square brackets: Value[Column].

You can also obtain the desired value using the ValueByName or ValueByIndex property.

Example

The following example demonstrates how to obtain the value stored in the specified cell.

JavaScript, JScript

function TableDataRowSample()
{
  var Logs, LogItem, LogData, DType, Row, Column, Value;
  // Obtains a log item
  Logs = Project.Logs;
  LogItem = Logs.LogItem(0);
  // Obtains the log item’s dataset
  LogData = LogItem.Data(0);

  DType = LogData.Scheme.DataType;
  // Checks whether the dataset corresponds to the table
  if (DType == 0)
  {
    // Obtains a table row by its index
    Row = LogData.Rows(0);
    // Obtains a table column by its name
    Column = LogData.Scheme.ColumnByName("Message");
    // Obtains the value stored in the cell
    Value = Row.Value(Column);
    // Posts the value to the test log
    Log.Message(aqConvert.VarToStr(Value));
  }

}

Python

def TableDataRowSample():
  # Obtains a log item
  Logs = Project.Logs
  LogItem = Logs.LogItem[0]
  # Obtains the log item's dataset
  LogData = LogItem.Data[0]
  DType = LogData.Scheme.DataType
  # Checks whether the dataset corresponds to the table
  if DType == 0:
    # Obtains a table row by its index
    Row = LogData.Rows[0]
    # Obtains a table column by its name
    Column = LogData.Scheme.ColumnByName["Message"]
    # Obtains the value stored in the cell
    Value = Row.Value[Column]
    # Posts the value to the test log
    Log.Message(aqConvert.VarToStr(Value))

VBScript

Sub TableDataRowSample

  ' Obtains a log item
  Set Logs = Project.Logs
  Set LogItem = Logs.LogItem(0)
  ' Obtains the log item’s dataset
  Set LogData = LogItem.Data(0)

  DType = LogData.Scheme.DataType
  ' Checks whether the dataset corresponds to the table
  If DType = 0 Then
    ' Obtains a table row by its index
    Set Row = LogData.Rows(0)
    ' Obtains a table column by its name
    Set Column = LogData.Scheme.ColumnByName("Message")
    ' Obtains the value stored in the cell
    Value = Row.Value(Column)
    ' Posts the value to the test log
    Log.Message(aqConvert.VarToStr(Value))
  End If

End Sub

DelphiScript

procedure TableDataRowSample();
var Logs, LogItem, LogData, DType, Row, Column, Value;
begin
  // Obtains a log item
  Logs := Project.Logs;
  LogItem := Logs.LogItem[0];
  // Obtains the log item’s dataset
  LogData := LogItem.Data[0];

  DType := LogData.Scheme.DataType;
  // Checks whether the dataset corresponds to the table
  if DType = 0 then
  begin
    // Obtains a table row by its index
    Row := LogData.Rows[0];
    // Obtains a table column by its name
    Column := LogData.Scheme.ColumnByName['Message'];
    // Obtains the value stored in the cell
    Value := Row.Value[Column];
    // Posts the value to the test log
    Log.Message(aqConvert.VarToStr(Value));
  end;

end;

C++Script, C#Script

function TableDataRowSample()
{
  var Logs, LogItem, LogData, DType, Row, Column, Value;
  // Obtains a log item
  Logs = Project["Logs"];
  LogItem = Logs.LogItem(0);
  // Obtains the log item’s dataset
  LogData = LogItem["Data"](0);

  DType = LogData["Scheme"]["DataType"];
  // Checks whether the dataset corresponds to the table
  if (DType == 0)
  {
    // Obtains a table row by its index
    Row = LogData["Rows"](0);
    // Obtains a table column by its name
    Column = LogData["Scheme"]["ColumnByName"]("Message");
    // Obtains the value stored in the cell
    Value = Row["Value"](Column);
    // Posts the value to the test log
    Log["Message"](aqConvert["VarToStr"](Value));
  }

}

See Also

Access Test Log Contents from Tests
ValueByIndex Property
ValueByName Property
LogColumn Object

Highlight search results