FlexTable Object

Note: Following the retirement of the Adobe Flash Player, UFT One no longer supports the Flex Add-in out of the box.

If you require the Flex Add-in, contact OpenText Support.

Description

A Flex data grid control.

Operations

The sections below list the built-in methods and properties that you can use as operations for the FlexTable object.

Note: You can also view a list and descriptions of the FlexTable description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.

Methods

Method ActivateColumnClicks the header of the specified column in the table.
ActivateCellDouble-clicks the specified cell in the grid.
Common Method CaptureBitmapSaves a screen capture of the object as a .png or .bmp image using the specified file name.
Common Method CheckChecks whether the actual value of an item matches the expected value.
Common Method CheckPropertyChecks whether the actual value of the specified object property matches the specified expected value within the specified timeout.
Common Method ChildObjectsReturns the collection of child objects contained within the object.
Common Method GetAllROProperties

Returns the collection of properties and current values from the object in the application.

Method ClickClicks an object.
Method CollapseRowCollapses a row in the table.
DblClickDouble clicks an object.
Method DeselectRowDeselects the specified row in the table.
Method ExpandRowExpands a row in the table.
Method ExtendRowSelects an additional row in the table.
Method GetCellChildObjectsReturns the collection of child objects contained within the specified table cell.
Method GetCellDataRetrieves the contents of the specified cell from the table.
Method GetColumnNameReturns the name of column specified by index.
Common Method GetROPropertyReturns the current value of the description property from the object in the application.
Common Method GetTOPropertiesReturns the collection of properties and values used to identify the object.
Common Method GetTOPropertyReturns the value of the specified description property from the test object description.
Common Method HighlightHighlights the object in the application.
Common Method OutputRetrieves the current value of an item and stores it in a specified location.
Common Method RefreshObjectInstructs UFT One to re-identify the object in the application the next time a step refers to this object.
Method SelectCellSelects the specified cell in the table.
Method SelectRowSelects the specified row in the table.
Method SelectRowsRangeSelects the specified range of rows in the table.
Method SetCellDataSets the contents of a cell to the specified text.
Common Method SetTOPropertySets the value of the specified description property in the test object description.
Method SortByColumnSorts an AdvancedDataGrid according to the selected column, in addition to any previous sorting.
Common Method ToStringReturns a string that represents the test object.
Common Method WaitPropertyWaits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Properties

Common Property ExistChecks whether the object currently exists in the open application.

Back to top

 

ActivateColumn Method

Description

Clicks the header of the specified column in the table.

Syntax

object.ActivateColumn (col)

Arguments

ParameterDescription
col Required. A Variant.

The name (with quotes) or index (without quotes) of the column to select. Index values begin with 0.

For columns with complex names, for example, if the column header contains an icon, use the column index. Alternatively, retrieve the column header from the parameter dataField in DataGridColumn, and use that name to specify the column.

Return Type

None.

IMPORTANT

  • When recording operations on columns, UFT One records the column name value for the col argument if the column name has a value and that value is unique among the names of the columns in the table.  Otherwise UFT One records the column index.
  • For an AdvancedDataGrid control, you can use the SortByColumn Method to sort by multiple columns.

 

Example

Back to top

ActivateCell Method

Description

Double-clicks the specified cell in the grid.

Syntax

object.ActivateCell (row, col, [X] , [Y], [Button])

Arguments

ParameterDescription
row Required. A long integer value.

The index of the row where the cell is located.  Index values begin with 0.

col Required. A Variant.
The name (with quotes) or index (without quotes) of the column where the cell is located. Index values begin with 0.

For columns with complex names, for example, if the column header contains an icon, use the column index. Alternatively, retrieve the column header from the parameter dataField in DataGridColumn, and use that name to specify the column.

X

Optional. An integer value.

The X-coordinate of the cell.

Default value: micLeftBtn

Y

Optional. An integer value.

The y-coordinate of the cell.

Default value: micLeftBtn

Button

Optional. A string.

The button used to double-click the specified cell.

Default value = micLeftBtn

Return Type

None

IMPORTANT

This method is supported only for running tests.

Back to top

 

Click Method

Description

Clicks an object.

Syntax

object.Click ([X], [Y], [BUTTON])

Arguments

ParameterDescription
X Optional. An integer value.

The x-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object.


Default value = -9999
Y Optional. An integer value.

The y-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object.


Default value = -9999
BUTTON Optional. A predefined constant or number.

The mouse button used to click the object.


Default value = micLeftBtn

Return Type

None.

Example

Back to top

DblClick Method

Description

Double clicks an object.

Syntax

object.Click ([X], [Y], [BUTTON])

Arguments

ParameterDescription
X Optional. An integer value.

The x-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object.


Default value = -9999
Y Optional. An integer value.

The y-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object.


Default value = -9999
BUTTON Optional. A predefined constant or number.

The mouse button used to click the object.


Default value = micLeftBtn

Return Type

None.

Example

Back to top

 

CollapseRow Method

Description

Collapses a row in the table.

Syntax

object.CollapseRow (row)

Arguments

ParameterDescription
row Required. A long integer value.
The index of the row to collapse. Index values begin with 0.

Return Type

None.

IMPORTANT

This method is relevant only for AdvancedDataGrid controls.

Example

Back to top

 

DeselectRow Method

Description

Deselects the specified row in the table.

Syntax

object.DeselectRow (row)

Arguments

ParameterDescription
row Required. A long integer value.
The index of the row to deselect. Index values begin with 0.

Return Type

None.

Example

Back to top

 

ExpandRow Method

Description

Expands a row in the table.

Syntax

object.ExpandRow (row)

Arguments

ParameterDescription
row Required. A long integer value.
The index of the row to expand. Index values begin with 0.

Return Type

None.

IMPORTANT

This method is relevant only for AdvancedDataGrid controls.

Example

Back to top

 

ExtendRow Method

Description

Selects an additional row in the table.

Syntax

object.ExtendRow (row)

Arguments

ParameterDescription
row Required. A long integer value.
The index of the row to select. Index values begin with 0.

Return Type

None.

IMPORTANT

This method is relevant only for tables that support selecting multiple rows.

Example

Back to top

 

GetCellChildObjects Method

Description

Returns the collection of child objects contained within the specified table cell.

Syntax

object.GetCellChildObjects (row, col, [Description])

Arguments

ParameterDescription
row Required. A long integer value.

The index of the row where the cell is located.  Index values begin with 0.

col Required. A Variant.

The name (with quotes) or index (without quotes) of the column where the cell is located. Index values begin with 0.

For columns with complex names, for example, if the column header contains an icon, use the column index. Alternatively, retrieve the column header from the parameter dataField in DataGridColumn, and use that name to specify the column.

Description Optional. An Object.

The Properties (collection) object containing the description of the child objects you want to retrieve.

Tip: You can retrieve a Properties collection using the GetTOProperties method or you can build a Properties collection object using the Description object. For more information on the Description object, refer to the Utility Objects section of the UFT One Object Model Reference.

Return Type

An Object.

A collection of test objects. The collection can be empty, or contain one or more objects, depending on the number of relevant child objects found.

IMPORTANT

  • Use this method to access objects that are embedded inside of Flex table cells, such as check boxes, radio buttons, and toggle buttons.
  • You may want to call the SelectCell method to activate the cell before accessing its content, as this sometimes changes the embedded objects.
  • The GetCellChildObjects method returns a cell's child objects only if the cell is visible. To make sure the cell is visible before calling this method, use the SelectCell or SelectRow methods.
  • The GetCellChildObjects method may not return a child object for plain text contained in a table cell. To retrieve or set this type of data, use the GetCellData or SetCellData methods.

Example

Back to top

 

GetCellData Method

Description

Retrieves the contents of the specified cell from the table.

Syntax

object.GetCellData (row, col)

Arguments

ParameterDescription
row Required. A long integer value.
The index of the row where the cell is located. Index values begin with 0.
col Required. A Variant.
The name (with quotes) or index (without quotes) of the column where the cell is located. Index values begin with 0.

For columns with complex names, for example, if the column header contains an icon, use the column index. Alternatively, retrieve the column header from the parameter dataField in DataGridColumn, and use that name to specify the column.

Return Type

A String value.

Example

Back to top

 

GetColumnName Method

Description

Returns the name of column specified by index.

Syntax

object.GetColumnName (col)

Arguments

ParameterDescription
col Required. A long integer value.
The index (without quotes) of the column where the cell is located. Index values begin with 0.

Return Type

A String value.

IMPORTANT

For columns with complex names, for example, if the column header contains an icon, the method returns the column header from the parameter dataField in the DataGridColumn.

Example

Back to top

 

SelectCell Method

Description

Selects the specified cell in the table.

Syntax

object.SelectCell (row, col, [X], [Y])

Arguments

ParameterDescription
row Required. A long integer value.
The index of the row where the cell is located. Index values begin with 0.
col Required. A Variant.
The name (with quotes) or index (without quotes) of the column where the cell is located. Index values begin with 0.

For columns with complex names, for example, if the column header contains an icon, use the column index. Alternatively, retrieve the column header from the parameter dataField in DataGridColumn, and use that name to specify the column.

X Optional. An integer value.
The x-coordinate of the location to click when selecting the cell. Note that the specified coordinates are relative to the upper left corner of the cell. The default is the center of the cell.
Default value = -9999
Y Optional. An integer value.
The y-coordinate of the location to click when selecting the cell. Note that the specified coordinates are relative to the upper left corner of the cell. The default is the center of the cell.
Default value = -9999

Return Type

None.

IMPORTANT

  • If the table cell contains embedded objects and you want to avoid clicking them when selecting the cell, provide the x and y arguments to specify a location to click inside the cell. 
  • This method is also useful for bringing the cell into view. For example, before calling GetCellChildObjects.

Example

Back to top

 

SelectRow Method

Description

Selects the specified row in the table.

Syntax

object.SelectRow (row, [X], [Y])

Arguments

ParameterDescription
row Required. A long integer value.
The index of the row to select. Index values begin with 0.
X Optional. A long integer value.
The x-coordinate of the location to click when selecting the row. Note that the specified coordinates are relative to the upper left corner of the row. The default is the center of the row.
Default value = -9999
Y Optional. A long integer value.
The y-coordinate of the location to click when selecting the row. Note that the specified coordinates are relative to the upper left corner of the row. The default is the center of the row.
Default value = -9999

Return Type

None.

IMPORTANT

  • If the table cells contain embedded objects and you want to avoid clicking them when selecting the row, provide the x and y arguments to specify a location to click inside the row. 
  • This method is also useful for bringing the row into view. For example, before calling GetCellChildObjects.

Example

Back to top

 

SelectRowsRange Method

Description

Selects the specified range of rows in the table.

Syntax

object.SelectRowsRange (FirstRow, LastRow)

Arguments

ParameterDescription
FirstRow Required. A long integer value.

The index of the first row in the range of rows to select. Index values begin with 0

LastRow Required. A long integer value.

The index of the last row in the range of rows to select. Index values begin with 0

Return Type

None.

IMPORTANT

This method is relevant only for tables that support selecting multiple rows.

Example

Back to top

 

SetCellData Method

Description

Sets the contents of a cell to the specified text.

Syntax

object.SetCellData (row, col, text)

Arguments

ParameterDescription
row Required. A long integer value.

The index of the row where the cell is located.  Index values begin with 0.

col Required. A Variant.
The name (with quotes) or index (without quotes) of the column where the cell is located. Index values begin with 0.

For columns with complex names, for example, if the column header contains an icon, use the column index. Alternatively, retrieve the column header from the parameter dataField in DataGridColumn, and use that name to specify the column.

text Required. A String value.

The contents to be entered into the specified cell.

Return Type

None.

IMPORTANT

When recording operations on columns, UFT One records the column name value for the col argument if the column name has a value and that value is unique among the names of the columns in the table.  Otherwise UFT One records the column index.

Example

Back to top

 

SortByColumn Method

Description

Sorts an AdvancedDataGrid according to the selected column, in addition to any previous sorting.

Syntax

object.SortByColumn (col)

Arguments

ParameterDescription
col Required. A Variant.

The name (with quotes) or index (without quotes) of the column to select. Index values begin with 0.

For columns with complex names, for example, if the column header contains an icon, use the column index. Alternatively, retrieve the column header from the parameter dataField in DataGridColumn, and use that name to specify the column.

Return Type

None.

IMPORTANT

  • This method is relevant only for AdvancedDataGrid controls.
  • If you sort by a column that is already sorted, its sort order is reversed.
  • Sorting by a column is equivalent to clicking on the right side of the column header (or, for tables defined with the sortExpertMode property set to true, holding the CTRL key and clicking the column header).

Example

Back to top

 

See also: