Unified Functional Testing Automation

Value Property

Description

DataTable default property. Retrieves or sets the value of the cell in the specified parameter and the current row of the design-time or run-time data table.

Note: This property returns the computed value of the cell. For example, if the cell contains a formula, the method returns True or False.

Syntax

To find the value:

DataTable.Value ParameterID, [SheetID]

or

DataTable ParameterID, [SheetID]

To set the value:

DataTable.Value(ParameterID, [SheetID])=NewValue

or

DataTable(ParameterID, [SheetID]) =NewValue

Argument

Type

Description

ParameterID
Variant
Identifies the parameter (column) of the value to be set/retrieved. Index values begin with 1.
SheetID
Variant
Optional. Identifies the sheet to be returned. The SheetID can be the sheet name, index or dtLocalSheet, or dtGlobalSheet.
If no Sheet is specified, the first sheet in the design-time or run-time data table is used (global sheet). Index values begin with 1.
NewValue
String
Sets the value for the specified table cell.

Example

The following example uses the Value property to set the value in the current row of the Destination parameter (column) in the "ActionA" sheet in the design-time or run-time data table.

DataTable.Value ("Destination", "ActionA")="New York"

The following example uses the Value property to set the value in the current row of the second parameter (column) in the third sheet.

DataTable.Value (2,3)="New York"

Note: You could omit the word Value in the statements above, because Value is the default property for the DataTable object.

The following example uses the default property to set the value in the current row of the Destination parameter (column) in the current (active) local sheet.

DataTable("Destination", "Action1")="New York"

The example below performs the equivalent of renaming a column (parameter) in the DataTable by copying the data from one column to a new column with a new name, and then deleting the old column.

'add a new column
DataTable.GetSheet("Global").AddParameter "NewColumn","Row1Value"

'copy the cells from the old column into the new column
cnt=DataTable.GetRowCount
For i=1 to cnt
    DataTable.SetCurrentRow(i)
    OldVal=DataTable.Value("OldColumn","Global")
    DataTable.Value("NewColumn","Global")=OldVal
Next

'delete the old column
DataTable.GetSheet("Global").DeleteParameter("OldColumn")