wValue Property (Grid Controls)

Applies to TestComplete 14.70, last modified on April 22, 2021
This property is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This property can be only used in tests that locate web objects by using internal identification properties provided by TestComplete.

Description

Use the wValue property to obtain or set the value held in the specified object cell.

Declaration

TestObj.wValue(RowColumn)

Read-Write Property Variant
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Row [in]    Required    Integer    
Column [in]    Required    Variant    

Applies To

The property is applied to the following objects:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Parameters

The property has the following parameters:

Row

Specifies the row (by its index) that contains the cell whose value you want to obtain or set. The index is zero-based, that is, the first row has index 0, the second - 1, and so on. The index of the last row is wRowCount-1.

Borland TDBGrid: The value of the wRowCount property includes only those rows that are currently visible in the grid. It does not include rows that are above and below the visible area.

Column

Specifies the column that contains the cell whose value you want to obtain or set.

The index is zero-based and corresponds to the column’s position within the object's internal columns collection rather than the column’s visible position in the object.

The caption can contain asterisk (*) or question mark (?) wildcards or regular expressions. The asterisk corresponds to a string of any length, the question mark corresponds to any single character. To specify more complicated parts of a caption, use regular expressions.

The caption can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting.

XtraVerticalGrid: The XtraVerticalGrid control may contain multi-editor columns. These columns contain several headers (or nested columns) within each column. TestComplete considers these nested columns as ordinary columns, and both types of columns share the same index space.

The following image illustrates a typical structure of the XtraVerticalGrid control:

Property Value

The value in the specified cell. If the cell is not found, wValue returns the null value (Nothing in VBScript, nil in DelphiScript, None in Python, null in JavaScript, JScript, C++Script and C#Script) and posts an error message to the test log.

Remarks

You can use the wValue property along with the wRowCount and wColumnCount properties to iterate through table cells.

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

WPF Toolkit DataGrid:

TestComplete supports only four types of WPF Toolkit DataGrid columns: DataGridTextColumn, DataGridCheckBoxColumn, DataGridComboBoxColumn and DataGridHyperlinkColumn.

The DataGridTemplateColumn type is not supported and you cannot get or set the values of the cells of the Template column.
Flex DataGrid:

If the grid is bound to a “raw” data object, such as Array, XML or XMLList, assigning a value to the wValue property changes only the cell’s display value but does not modify the grid’s underlying data source. In this case, the displayed value is reset the original value once the grid refreshes.

To change cell values in an editable grid, simulate actual input into in-place editors. For example, use the ClickCell action to activate the in-place editor, then simulate entering or selecting a new value, and then use Keys("[Enter]") to commit the changes. See Common Operations for Grids.

The above limitation is not applied to grids bound to collection objects, such as ArrayList, ArrayCollection or XMLListCollection. To learn what data object type is used in the grid control, ask the tested application’s developers.

Example

To view an example that demonstrates how to use the wValue property, see Working With Grids - Basic Concepts.

See Also

wValue Property (Specific to DevExpressQuantumGrid Controls)
wValue Property (Specific to Qt TableWidget Controls)
wValue Property (Specific to PropertyGrid Controls)
wColumn Property (Grid Controls)

Highlight search results