Object Model Reference for GUI Testing > SAP Gui for Windows > ActivateCell Method

SAPGuiGrid Object

Description

A grid control in an SAP GUI for Windows application.

Operations

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

Note: You can also view a list and descriptions of the SAPGuiGrid 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 ActivateCell Double-clicks the specified cell in a grid.
Method ActivateColumn Double-clicks the specified column in a grid.
Method ActivateRow Double-clicks the specified row in a grid.
Common Method CaptureBitmap Saves a screen capture of the object as a .png or .bmp image using the specified file name.
Common Method Check Checks whether the actual value of an item matches the expected value.
Common Method CheckProperty Checks whether the actual value of the specified object property matches the specified expected value within the specified timeout.
Common Method ChildObjects Returns the collection of child objects contained within the object.
Method ClearSelection Clears any selected rows or columns in a grid.
Method ClickCell Clicks the specified cell in a grid.
Method ColumnCount Retrieves the number of columns in the grid.
Method DeselectColumn Clears the selection of the specified column.
Method DeselectRow Clears the selection of the specified row.
Method DeselectRowsRange Deselects the specified rows in the grid.
Method ExtendColumn Selects an additional column in the grid.
Method ExtendRow Selects an additional row in the grid.
Method ExtendRowsRange Adds the specified range of rows to the selected rows in the grid.
Method FindAllRowsByCellContent Retrieves all rows of all cells in the given column whose content matches the specified data.
Method FindRowByCellContent Retrieves the first row of the cell in the given column whose content matches the specified data.
Method GetCellData Returns the data contained in the specified cell.
Common Method GetROProperty Returns the current value of the description properties from the object in the application.
Common Method GetTOProperties Returns the collection of properties and values used to identify the object.
Common Method GetTOProperty Returns the value of the specified description properties from the test object description.
Method Input Records an Input statement each time new or modified table cell data is sent to the SAP server.
Method IsCellEditable Checks whether the cell is editable.
Method OpenPossibleEntries Opens the list of possible entries for a specified cell in a grid.
Common Method Output Retrieves the current value of an item and stores it in a specified location.
Method PressEnter Presses the ENTER keyboard key when a grid control is in focus.
Common Method RefreshObject Instructs UFT to re-identify the object in the application the next time a step refers to this object.
Method RowCount Returns the number of rows in the grid.
Method SelectAll Selects all cells in a grid.
Method SelectCell Selects the specified cell in a grid.
Method SelectColumn Selects the specified column in the grid.
Method SelectMenuItemById Selects a menu item from a context menu (opened by right-clicking the grid) based on the specified SAP ID.
Method SelectRow Selects the specified row in the grid.
Method SelectRowsRange Selects the specified range of rows in the grid.
Method SetCellData Sets the cell contents with the specified data.
Method SetCheckbox Sets the specified checkbox in a grid.
Common Method SetTOProperty Sets the value of the specified description properties in the test object description.
Common Method ToString Returns a string that represents the test object.
Common Method WaitProperty Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Properties

Common Property Exist Checks whether the object currently exists in the open application.
Common Property Object Accesses the native methods and properties of the object.

 

Back to top

ActivateCell Method

Description

Double-clicks the specified cell in a grid.

Syntax

object.ActivateCell (Row, Column)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell to activate. Row numbers begin with 1.
Column Required. A String value.
The column of the cell to activate. The column can be specified by the column's label or column number in the format "#index". Column numbers begin with 1.

Return Type

None.

Example


 

Back to top

ActivateColumn Method

Description

Double-clicks the specified column in a grid.

Syntax

object.ActivateColumn (Column)

Arguments

Parameter Description
Column Required. A String value.
The column to activate. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.

Return Type

None.

IMPORTANT

Activating the column selects the entire column, or in certain cases, displays another window.

Example


 

Back to top

ActivateRow Method

Description

Double-clicks the specified row in a grid.

Syntax

object.ActivateRow (Row)

Arguments

Parameter Description
Row Required. A long integer value.
The row number to activate. Row numbers begin with 1.

Return Type

None.

IMPORTANT

We recommend using an SAPGuiGrid.SelectRow statement before using this method.

Example


 

Back to top

ClearSelection Method

Description

Clears any selected rows or columns in a grid.

Syntax

object.ClearSelection

Return Type

None.

IMPORTANT

This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the Unified Functional Testing User Guide.

Example


 

Back to top

ClickCell Method

Description

Clicks the specified cell in a grid.

Syntax

object.ClickCell (Row, Column)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell to click.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell to click. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

IMPORTANT

This method is generally recorded when a button is pressed within a cell or if another item is pressed, resulting in a communication with the SAP server.

Example


 

Back to top

ColumnCount Method

Description

Retrieves the number of columns in the grid.

Syntax

object.ColumnCount

Return Type

A Variant.

Example


 

Back to top

DeselectColumn Method

Description

Clears the selection of the specified column.

Syntax

object.DeselectColumn (Column)

Arguments

Parameter Description
Column Required. A String value.
The column to deselect. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example


 

Back to top

DeselectRow Method

Description

Clears the selection of the specified row.

Syntax

object.DeselectRow (Row)

Arguments

Parameter Description
Row Required. A long integer value.
The number of the row to deselect.
Row numbers begin with 1.

Return Type

None.

IMPORTANT

This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the Unified Functional Testing User Guide.

Example


 

Back to top

DeselectRowsRange Method

Description

Deselects the specified rows in the grid.

Syntax

object.DeselectRowsRange (From, To)

Arguments

Parameter Description
From Required. A long integer value.
The number of the first row to deselect.
Row numbers begin with 1.
To Required. A long integer value.
The number of the last row to deselect.
Row numbers begin with 1.

Return Type

None.

IMPORTANT

This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the Unified Functional Testing User Guide.

Example


 

Back to top

ExtendColumn Method

Description

Selects an additional column in the grid.

Syntax

object.ExtendColumn (Column)

Arguments

Parameter Description
Column Required. A String value.
The column to add to the selection. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example


 

Back to top

ExtendRow Method

Description

Selects an additional row in the grid.

Syntax

object.ExtendRow (Row)

Arguments

Parameter Description
Row Required. A long integer value.
The number of the row to add to the selection.
Row numbers begin with 1.

Return Type

None.

Example


 

Back to top

ExtendRowsRange Method

Description

Adds the specified range of rows to the selected rows in the grid.

Syntax

object.ExtendRowsRange (From, To)

Arguments

Parameter Description
From Required. A long integer value.
The number of the first row to add to the selection.
Row numbers begin with 1.
To Required. A long integer value.
The number of the last row to add to the selection.
Row numbers begin with 1.

Return Type

None.

Example


 

Back to top

FindAllRowsByCellContent Method

Description

Retrieves all rows of all cells in the given column whose content matches the specified data.

Syntax

object.FindAllRowsByCellContent (Col, CellText)

Arguments

Parameter Description
Col Required. A Variant.
The column in which you want to search. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.
CellText Required. A Variant.
The data for which you want to search.

Return Type

A Variant.

Example


 

Back to top

FindRowByCellContent Method

Description

Retrieves the first row of the cell in the given column whose content matches the specified data.

Syntax

object.FindRowByCellContent (Col, CellText, [StartFromRow])

Arguments

Parameter Description
Col Required. A Variant.
The column in which you want to search. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.
CellText Required. A Variant.
The data for which you want to search.
StartFromRow Optional. A Variant.
The row in which you want the search to start. Row numbers begin with 1.
Default value = 1

Return Type

A Variant.

If no content matches the specified value, the return value is NULL.

Example


 

Back to top

GetCellData Method

Description

Returns the data contained in the specified cell.

Syntax

object.GetCellData (Row, Column)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell for which you want to retrieve data.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell for which you want to retrieve data. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

A Variant.

Example


 

Back to top

Input Method

Description

Records an Input statement each time new or modified table cell data is sent to the SAP server.

Syntax

object.Input (DataSheet, [ScrollMethod])

Arguments

Parameter Description
DataSheet Required. A String value.
The name of the input data sheet containing the data for the grid.
ScrollMethod Optional. A tagSCROLL_METHOD Value.
The keyboard key that UFT uses to scroll or add rows to the grid if the input data sheet includes rows that exceed the number of rows currently displayed in the application.
Possible values:
82 or PAGEDOWN: (default) Sends a Page Down key command to scroll the grid.
0 or ENTER: Sends an Enter key command to scroll the grid.
For details on when to use this argument, refer to the "Using the Auto-Parameterize Option to Parameterize Table Cell Values" section of the Unified Functional Testing SAP Solutions Add-in Guide.
Default value = micPageDown

Return Type

None.

IMPORTANT

This method is recorded only if the Auto-parameterize table and grid controls option is selected in the SAP pane of the Options dialog box.

When the Auto-parameterize table and grid controls option is selected, an Input statement is recorded each time new or modified grid cell data is sent to the SAP server. The statement represents all cell values that were set prior to sending the data to the server.

For each recorded Input method, a corresponding input data sheet is automatically inserted in the test's Data Table as a sub-sheet of the action data sheet containing the recorded cell values. Columns are added to the data sheet only for cells containing input data.

Once the new input data sheet has been created by recording the Input statement, you can add or modify the data set, and add additional data sets for each action iteration.

During the test run, this method inserts the values from the input data sheet specified by the SheetName argument into the grid.

During each action iteration, the values of all cells in the relevant data set of the input data sheet are inserted into the grid according to the row position and column name.

Notes:

You must record the Input method using the Auto-parameterize table and grid controls option to create the input data sheet. You cannot create the required input data sheet manually.

A SelectCell method is automatically recorded after each Input statement.

When the Auto-parameterize table and grid controls option is not selected, a SetCellData statement is recorded for each value you set in a grid cell.

For a detailed explanation of how to work with the Input statement and how to edit or add data sets to the input data sheet, refer to the "Using the Auto-Parameterize Option to Parameterize Table Cell Values" section of the Unified Functional Testing SAP Solutions Add-in Guide.

Example


 

Back to top

IsCellEditable Method

Description

Checks whether the cell is editable.

Syntax

object.IsCellEditable (Row, Col)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell to check.
Row numbers begin with 1.
Col Required. A Variant.
The column of the cell to check. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.

Return Type

A Variant.

Example


 

Back to top

OpenPossibleEntries Method

Description

Opens the list of possible entries for a specified cell in a grid.

Syntax

object.OpenPossibleEntries (Row, Column)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell for which you want to open the Possible Entries dialog box.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell for which you want to open the Possible Entries dialog box. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example


 

Back to top

PressEnter Method

Description

Presses the ENTER keyboard key when a grid control is in focus.

Syntax

object.PressEnter

Return Type

None.

Example


 

Back to top

RowCount Method

Description

Returns the number of rows in the grid.

Syntax

object.RowCount

Return Type

A Variant.

Example


 

Back to top

SelectAll Method

Description

Selects all cells in a grid.

Syntax

object.SelectAll

Return Type

None.

Example


 

Back to top

SelectCell Method

Description

Selects the specified cell in a grid.

Syntax

object.SelectCell (Row, Column)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell to select.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell to select. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example


 

Back to top

SelectColumn Method

Description

Selects the specified column in the grid.

Syntax

object.SelectColumn (Column)

Arguments

Parameter Description
Column Required. A String value.
The column to select. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example


 

Back to top

SelectMenuItemById Method

Description

Selects a menu item from a context menu (opened by right-clicking the grid) based on the specified SAP ID.

Syntax

object.SelectMenuItemById (MenuItemId)

Arguments

Parameter Description
MenuItemId Required. A String value.
The internal SAP ID for the menu item.

Return Type

None.

IMPORTANT

When a context menu opens from a grid, UFT always records a SelectColumnmethod, SelectRow method, or SelectCellmethod, and then records the SelectMenuItemById method. If you want to add a SelectMenuItemById method manually in the Editor, be sure to include one of the Select* methods mentioned above before the SelectMenuItemById method.

Example


 

Back to top

SelectRow Method

Description

Selects the specified row in the grid.

Syntax

object.SelectRow (Row)

Arguments

Parameter Description
Row Required. A long integer value.
The number of the row to select.
Row numbers begin with 1.

Return Type

None.

Example


 

Back to top

SelectRowsRange Method

Description

Selects the specified range of rows in the grid.

Syntax

object.SelectRowsRange (From, To)

Arguments

Parameter Description
From Required. A long integer value.
The number of the first row to select.
Row numbers begin with 1.
To Required. A long integer value.
The number of the last row to select.
Row numbers begin with 1.

Return Type

None.

Example


 

Back to top

SetCellData Method

Description

Sets the cell contents with the specified data.

Syntax

object.SetCellData (Row, Column, Data)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell for which you want to specify data.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell for which you want to specify data. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.
Data Required. A String value.
The data to set for the specified cell.
The possible values for the data depends on the type of cell. For example, the values may be "ON" or "OFF" for a check box or radio button cell, or may be limited to the available values of a combo box.

Return Type

None.

IMPORTANT

This method is recorded only when the Auto-parameterize tables and grids option is not selected in the SAP pane of the Options dialog box.

Example


 

Back to top

SetCheckbox Method

Description

Sets the specified checkbox in a grid.

Syntax

object.SetCheckbox (Row, Col, Value)

Arguments

Parameter Description
Row Required. A long integer value.
The row number of the cell whose check box state you want to set.
Row numbers begin with 1.
Col Required. A String value.
The column of the cell whose check box state you want to set. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.
Value Required. A String value.
The state of the check box.
     "ON"
     "OFF"

Return Type

None.

Example


Back to top

See also: