WpfDXGrid Object
Description
A DevExpress Data Grid control in a WPF application.
IMPORTANT
Because WPF Automation Elements of the same control type may support a different set of control patterns, the test object methods or properties that OpenText Functional Testing supports for a specific WpfDXGrid test object may be different from the standard set of methods and properties listed in this section. For more information on control patterns, see the WPF Add-in section of the OpenText Functional Testing Help Center.
For a list of supported grid control versions, see the OpenText Functional Testing Support Matrix.
Operations
The sections below list the built-in methods and properties that you can use as operations for the WpfDXGrid object.
Note: You can also view a list and descriptions of the WpfDXGrid 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
ActivateCell | Double-clicks the specified cell in a grid. |
AddCellToSelection | Selects a cell in addition to previously selected cells. |
AddRowToSelection | Selects a row in addition to previously selected rows. |
CaptureBitmap | Saves a screen capture of the object as a .png or .bmp image using the specified file name. |
Check | Checks whether the actual value of an item matches the expected value. |
CheckProperty | Checks whether the actual value of the specified object property matches the specified expected value within the specified timeout. |
ChildObjects | Returns the collection of child objects contained within the object. |
Clears the existing column grouping. | |
ClearSelection | Deselects any selected rows or cells in the grid. |
Click | Clicks the object. |
Collapses all group rows in the grid. | |
Collapses the specified group row. | |
DblClick | Double-clicks the object. |
DeselectCell | Deselects the specified cell. |
DeselectRow | Deselects the specified row. |
Drag | Performs the 'drag' part of a drag-and-drop operation. |
Drop | Performs the 'drop' part of a drag-and-drop operation. |
Expands all group rows in the grid. | |
Expands the specified group row. | |
GetAllROProperties | Returns the collection of properties and current values from the object in the application. |
GetCellData | Retrieves the contents of the specified cell in the grid. |
GetCellProperty | Returns the value of a grid cell property. |
GetColumnCount | Returns the number of columns in the grid. |
GetColumnNames | Returns the headers of the columns in the grid. |
GetROProperty | Returns the current value of the description property from the object in the application. |
GetRowCount | Returns the number of rows in the grid. |
GetTOProperties | Returns the collection of properties and values used to identify the object. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
GetVisibleText | Returns the text from the specified area. |
Groups data by the specified column. | |
Hides the specified column. | |
Highlight | Highlights the object in the application. |
IsRowSelected | Indicates whether the specified row is selected. |
Scrolls the specified cell into view if it is not visible in the grid. | |
MakeVisible | Scrolls the object into view if it is not visible in the parent window. |
MouseMove | Moves the mouse pointer to the designated position over the object. |
Moves the specified column to the specified destination column's position. | |
Output | Retrieves the current value of an item and stores it in a specified location. |
RefreshObject | Instructs OpenText Functional Testing to re-identify the object in the application the next time a step refers to this object. |
SelectCell | Selects (clicks) the specified cell in the grid. |
SelectRow | Selects the specified row. |
SetCellData | Sets the contents of a cell with the specified string. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
Expands the parent rows of the specified view and makes it the current view. | |
Makes the specified column visible in the grid. | |
ShowContextMenu | Displays the control's context menu. |
ToString | Returns a string that represents the test object. |
Type | Types the specified string in the object. |
Ungroups data by the specified column. | |
WaitProperty | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Properties
AutomationElement | Accesses the native methods and properties of the AutomationElement object for the corresponding user interface object. |
AutomationPattern | The object that provides access to the specified Control Pattern for the run-time object. |
Exist | Checks whether the object currently exists in the open application. |
Object | Accesses the native methods and properties of the object. |
SupportedPatterns | Returns all of the currently supported patterns of the object. |
ActivateCell Method
Description
Double-clicks the specified cell in a grid.
Syntax
object.ActivateCell row, Column
Arguments
Parameter | Description |
---|---|
row |
Required. A Variant. The 0-based number of the row you want to activate. |
Column |
Required. A Variant. The location of the column within the grid. Use the column header name or the 0-based column number. |
Return Type
None
Example
'The following example uses the ActivateCell method to activate the cell in the second row of the "Age" 'column in the WpfDXGrid. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").ActivateCell 1,"Age"
AddCellToSelection Method
Description
Selects a cell in addition to previously selected cells.
Syntax
object.AddCellToSelection row, Column
Arguments
Parameter | Description |
---|---|
row |
Required. A Variant. The 0-based number of the row you want to add to the selection. |
Column |
Required. A Variant. The location of the column within the grid. Use the column header name or the 0-based column number. |
Return Type
None
Example
'The following example uses the AddCellToSelection method to select the cell in the 'second row of the "Age" column in the WpfDXGrid in addition to any cells already selected. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").AddCellToSelection 1,"Age"
AddRowToSelection Method
Description
Selects a row in addition to previously selected rows.
Syntax
object.AddRowToSelection row
Arguments
Parameter | Description |
---|---|
row |
Required. A Variant. The 0-based number of the row you want to add to the selection. |
Return Type
None
Example
'The following example uses the AddRowToSelection method to select the second row 'in the WpfDXGrid in addition to any rows already selected. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").AddRowToSelection 1
ClearGrouping
Description
Clears the existing column grouping.
Syntax
object.ClearGrouping
Return Type
None.
Example
'The following example groups the WpfDXGrid by the Name column and 'then uses the ClearGrouping method to clear the grouping. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Name" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").ClearGrouping
ClearSelection Method
Description
Deselects any selected rows or cells in the grid.
Syntax
object.ClearSelection
Return Type
None.
Example
'The following example selects a few rows in the WpfDXGrid and then uses the 'ClearSelection method to deselect them all. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SelectRow 6 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").AddRowToSelection 1 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").AddRowToSelection 3 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").ClearSelection
Click Method
Description
Clicks the object.
Syntax
object.Click ([X], [Y], [BUTTON])
Arguments
Parameter | Description |
---|---|
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. Tip: You can enter micNoCoordinate (-9999) for the x and y argument values if you want to enter a value for the BUTTON argument without specifying x- and y- coordinates for the click. micNoCoordinate indicates 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
'The following example uses the Click method to click the left mouse button 'on the WpfDXGrid. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").Click
CollapseAllGroups
Description
Collapses all group rows in the grid.
Syntax
object.CollapseAllGroups
Return Type
None.
Example
'The following example groups the WpfDXGrid by the Name and Number columns, 'then uses the CollapseAllGroups method to collapse the groups. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Name" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Number" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").CollapseAllGroups
CollapseRow
Description
Collapses the specified group row.
Syntax
object.CollapseRow row
Arguments
Parameter | Description |
---|---|
row | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. |
Return Type
None.
Example
'The following example groups the WpfDXGrid by the Name and Number columns, 'then uses the CollapseRow method to collapse a row. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Name" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Number" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").CollapseRow 3
DblClick Method
Description
Double-clicks the object.
Syntax
object.DblClick (X, Y, [BUTTON])
Arguments
Parameter | Description |
---|---|
X |
Required. An integer value. The x-coordinate of the double-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. |
Y |
Required. 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. Tip: You can enter micNoCoordinate (-9999) for the x and y argument values if you want to enter a value for the button argument without specifying x- and y- coordinates for the click. micNoCoordinate indicates the center of the object. |
BUTTON |
Optional. A predefined constant or number. The mouse button used to double-click the object. Default value = micLeftBtn |
Return Type
None.
Example
'The following example uses the DblClick method to Double-Click a WpfDXGrid object at 'coordinates 2, 2. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").DblClick 2, 2
DeselectCell Method
Description
Deselects the specified cell.
Syntax
object.DeselectCell row, column
Arguments
Parameter | Description |
---|---|
row | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. |
column | Required. A Variant. The location of the column within the grid. Specify the column header name (string) or the 0-based column number. |
Return Type
None.
Example
'This example uses the DeselectCell method to deselect the first cell in a DevExpress 'Data Grid and then deselect the Invoice Details cell in the 6th row. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SelectCell 0, 0 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").AddCellToSelection 5, "Invoice Details" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").DeselectCell 0, 0 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").DeselectCell 5, "Invoice Details"
DeselectRow Method
Description
Deselects the specified row.
Syntax
object.DeselectRow row
Arguments
Parameter | Description |
---|---|
row | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. |
Return Type
None.
Example
'This example uses the DeselectRow method to deselect the first row
' in a DevExpress Data Grid.
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SelectRow 0
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").DeselectRow 0
Drag Method
Description
Performs the 'drag' part of a drag-and-drop operation.
Syntax
object.Drag ([X], [Y], [BUTTON])
Arguments
Parameter | Description |
---|---|
X |
Optional. An integer value. The x-coordinate within the window from which the object is dragged. Note that the specified coordinates are relative to the upper left corner of the object. Default value = -9999 |
Y |
Optional. An integer value. The y-coordinate within the window from which the object is dragged. Note that the specified coordinates are relative to the upper left corner of the object. Default value = -9999 |
BUTTON |
Optional. A predefined constant or number. The mouse button used to drag the object. Default value = micLeftBtn |
Return Type
None.
Example
'The following example uses the Drag and Drop methods to move a WpfDXGrid. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").Drag 4, 8 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").Drop 24, 8
Drop Method
Description
Performs the 'drop' part of a drag-and-drop operation.
Syntax
object.Drop ([X], [Y], [BUTTON])
Arguments
Parameter | Description |
---|---|
X |
Optional. An integer value. The x-coordinate of the object onto which the object is dropped. Note that the specified coordinates are relative to the upper left corner of the object. Default value = -9999 |
Y |
Optional. An integer value. The y-coordinate of the object onto which the object is dropped. Note that the specified coordinates are relative to the upper left corner of the object. Default value = -9999 |
BUTTON |
Optional. A predefined constant or number. The mouse button that is released to drop the object. Default value = micLeftBtn |
Return Type
None.
Example
'The following example uses the Drag and Drop methods to move a WpfDXGrid. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").Drag 4, 8 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").Drop 24, 8
ExpandAllGroups
Description
Expands all group rows in the grid.
Syntax
object.ExpandAllGroups
Return Type
None.
Example
'The following example groups the WpfDXGrid by the Name and Number columns, 'collapses all the groups, then uses the ExpandAllGroups method to expand them. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Name" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Number" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").CollapseAllGroups WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").ExpandAllGroups
ExpandRow
Description
Expands the specified group row.
Syntax
object.ExpandRow row
Arguments
Parameter | Description |
---|---|
row | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. |
Return Type
None.
Example
'The following example groups the WpfDXGrid by the Name and Number columns, 'collapses a row, then uses the ExpandRow method to expand it. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Name" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn "Number" WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").CollapseRow 3 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").ExpandRow 3
GetCellData Method
Description
Retrieves the contents of the specified cell in the grid.
Syntax
object.GetCellData (row, Column)
Arguments
Parameter | Description |
---|---|
row |
Required. A Variant. The 0-based index of the row containing the cell whose data you want to retrieve. |
Column |
Required. A Variant. The location of the column within the grid. Use the column header name or the 0-based column number. |
Return Type
A String value.
Example
'The following example uses the GetCellData method to return the data contained in the second row of the "Age" 'column in the WpfDXGrid. MyData = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetCellData(1, "Age") MsgBox(MyData)
GetCellProperty Method
Description
Returns the value of a grid cell property.
Syntax
object.GetCellProperty Row, Column, PropertyName
Arguments
Parameter | Description |
---|---|
Row | Required. A Variant. The 0-based index of the row within the grid. |
Column | Required. A Variant. The location of the column within the grid. Specify the column header name or the 0-based column number. |
PropertyName |
Required. A String value. The name of the property, specified as a string. Possible values:
|
Return Type
A Variant.
Returns the value of the specified property.
If the specified PropertyName is not one of the supported properties, a NOT_IMPLEMENTED error occurs.
Example
'This example uses the GetCellProperty method to get the value of the "x" property for the cell 'located in the ninth row, third column of the "myDataGrid" WpfDXGrid. Dim strCellProp strCellProp = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetCellProperty(8, 2, "x")
GetColumnCount Method
Description
Returns the number of columns in the grid.
Syntax
object.GetColumnCount [includeHiddenColumns]
Arguments
Parameter | Description |
---|---|
includeHiddenColumns | Optional. A Boolean value. Indicates whether to include the grid's hidden columns in the count. (Default = false) |
Return Type
An Integer.
Example
'This example uses the GetColumnCount method to return the number of visible columns in the grid
'and the number of all columns, including the hidden ones.
ColumnCount = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetColumnCount
MsgBox ColumnCount
ColumnCount = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetColumnCount True
MsgBox ColumnCount
GetColumnNames Method
Description
Returns the headers of the columns in the grid.
Syntax
object.GetColumnNames [includeHiddenColumns]
Arguments
Parameter | Description |
---|---|
includeHiddenColumns | Optional. A Boolean value. Indicates whether to include the names of the grid's hidden columns. (Default = false) |
Return Type
A list of strings.
Example
'This example uses the GetColumnNames method to return the names of all visible columns in the
'grid, and then the names of all columns, including the hidden ones.
Dim ColumnNames
Set ColumnNames = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetColumnNames
ColumnNamesCount = ColumnNames.Count
For i = 0 To ColumnNamesCount - 1
Print ColumnNames(i).Name & ": " & ColumnNames(i).Value
Next
Set ColumnNames = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetColumnNames True
ColumnNamesCount = ColumnNames.Count
For i = 0 To ColumnNamesCount - 1
Print ColumnNames(i).Name & ": " & ColumnNames(i).Value
Next
GetRowCount Method
Description
Returns the number of rows in the grid.
Syntax
object.GetRowCount [includeHiddenRows]
Arguments
Parameter | Description |
---|---|
includeHiddenRows | Optional. A Boolean value. Indicates whether to include the grid's hidden rows in the count. (Default = false) Note: When data grouping is applied, group rows are not included in the count if you set the parameter to true. |
Return Type
An Integer.
Example
'This example uses the GetRowCount method to return the number of visible rows in the grid
'and the number of all rows, including the hidden ones.
RowCount = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetRowCount
MsgBox RowCount
RowCount = WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetRowCount True
MsgBox RowCount
GetVisibleText Method
Description
Returns the text from the specified area.
Syntax
object.GetVisibleText ([Left], [Top], [Right], [Bottom])
Arguments
Parameter | Description |
---|---|
Left |
Optional. A long integer value. The left coordinate of the search area within the object’s window. Default value = -1 |
Top |
Optional. A long integer value. The top coordinate of the search area the object’s window. Default value = -1 |
Right |
Optional. A long integer value. The right coordinate of the search area within the object’s window. Default value = -1 |
Bottom |
Optional. A long integer value. The bottom coordinate of the search area a within the object’s window. Note: If the Left, Top, Right, and Bottom arguments are not specified, the method returns all of the text within the visible part of the specified object. Default value = -1 |
Return Type
A String value.
IMPORTANT
The text to capture must be visible in the application window when the step runs.
The area is defined by pairs of coordinates that designate two diagonally opposite corners of a rectangle.
Note:
The GetVisibleText method may behave differently in different run sessions depending on the operating system version you are using, service packs you have installed, other installed toolkits, or the APIs used in your application. Therefore, when possible, it is highly recommended to use the GetROProperty Method or the Object property to retrieve the value of the text (or equivalent) property from an object in your application instead of using the GetVisibleText method.
By default, when OpenText Functional Testing captures text for a text/text area checkpoint or output value step using the GetText, GetTextLocation, or GetVisibleText methods, it tries to retrieve the text directly from the object using a Windows API-based mechanism. If OpenText Functional Testing cannot capture the text this way (for example, because the text is part of a picture), it tries to capture the text using an OCR (optical character recognition) mechanism. For details about changing this behavior, see the Can QuickTest Professional Text Recognition behavior be modified Knowledgebase article (number KM202721).
Example
'The following example uses the GetVisibleText method to retrieve the text displayed 'inside a WpfDXGrid. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GetVisibleText
GroupByColumn
Description
Groups data by the specified column.
Syntax
object.GroupByColumn column
Arguments
Parameter | Description |
---|---|
column | Required. A Variant. The location of the column within the grid. Specify the column header name or the 0-based column number. |
Return Type
None.
Example
'The following example groups the WpfDXGrid by the first column. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn 0
HideColumn
Description
Hides the specified column.
Syntax
object.HideColumn column
Arguments
Parameter | Description |
---|---|
column | Required. A Variant. The location of the column within the grid. Specify the column header name or the 0-based column number. |
Return Type
None.
IMPORTANT
OpenText Functional Testing does not record HideColumn steps. You can add them to your test manually.
Example
'The following example hides the WpfDXGrid's first column. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").HideColumn 0
IsRowSelected Method
Description
Indicates whether the specified row is selected.
Syntax
object.IsRowSelected row
Arguments
Parameter | Description |
---|---|
row | A row of Variant type. The location of the row within the grid. Specify the 0-based number of the row. |
Return Type
A Boolean value.
Example
'This example uses the IsRowSelected method to check whether a row in the grid is selected. If WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").IsRowSelected(2) Then MsgBox "Row 2 is selected." End If
MakeCellVisible
Description
Scrolls the specified cell into view if it is not visible in the grid.
Syntax
object.MakeCellVisible row, column
Arguments
Parameter | Description |
---|---|
row | A row of Variant type. The location of the row within the grid. Specify the 0-based number of the row. |
column | Required. A Variant. The location of the column within the grid. Specify the column header name or the 0-based column number. |
Return Type
None.
IMPORTANT
OpenText Functional Testing does not record MakeCellVisible steps. You can add them to your test manually.
Example
'The following example brings a cell in the WpfDXGrid's into view. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MakeCellVisible 0, 3
MakeVisible Method
Description
Scrolls the object into view if it is not visible in the parent window.
Syntax
object.MakeVisible
Return Type
None.
Example
'The following example uses the MakeVisible method to scroll the 'WpfTabStrip' WpfDXGrid 'object into the view area. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MakeVisible
MouseMove Method
Description
Moves the mouse pointer to the designated position over the object.
Syntax
object.MouseMove (X, Y)
Arguments
Parameter | Description |
---|---|
X |
Required. An integer value. The x-coordinate of the mouse pointer, relative to the upper left corner of the object. |
Y |
Required. An integer value. The y-coordinate of the mouse pointer, relative to the upper left corner of the object. |
Return Type
None.
Example
'The following example uses the MouseMove method to move the mouse pointer to the top 'left corner of the 'WpfDXGrid' object. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MouseMove 0, 0
MoveColumn
Description
Moves the specified column to the specified destination column's position.
Syntax
object.MoveColumn sourceColumn, desntinationColumn, [insertAfter]
Arguments
Parameter | Description |
---|---|
sourceColumn | Required. A Variant. The location of the column to move within the grid. Specify the column header name or the 0-based column number. |
destinationColumn | Required. A Variant. The new location for the column within the grid. Specify the column header name or the 0-based column number. |
insertAfter | Optional. A Boolean. Indicates whether to insert the column in the grid after the specified destination column. Default=false. The column is inserted before the specified column. |
Return Type
None.
IMPORTANT
OpenText Functional Testing does not record MoveColumn steps. You can add them to your test manually.
Example
'This example uses the MoveColumn method to move columns around inside the grid.
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MoveColumn 0, 1
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MoveColumn 0, 1, True
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MoveColumn 2, "Discount"
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MoveColumn "ID", 1
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MoveColumn "ID", 1, True
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MoveColumn "ID", "Price"
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").MoveColumn "ID", "Price", True
SelectCell Method
Description
Selects (clicks) the specified cell in the grid.
Syntax
object.SelectCell row, Column
Arguments
Parameter | Description |
---|---|
row |
Required. A Variant. The 0-based index of the row containing the cell you want to select. |
Column |
Required. A Variant. The location of the column within the grid. Use the column header name or the 0-based column number. |
Return Type
None
Example
'The following example uses the SelectCell method to select the cell in the second row of the "Age" 'column in the WpfDXGrid. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SelectCell 1, "Age"
SelectRow Method
Description
Selects the specified row.
Syntax
object.SelectRow Row
Arguments
Parameter | Description |
---|---|
Row | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. |
Return Type
None
Example
'This example uses the SelectRow method with DevExpress Data Grid control to select the seventh row. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SelectRow 6
SetCellData Method
Description
Sets the contents of a cell with the specified string.
Syntax
object.SetCellData row, Column, data
Arguments
Parameter | Description |
---|---|
row |
Required. A Variant. The 0-based index of the row containing the cell data you want to set. |
Column |
Required. A Variant. The location of the column within the grid. Use the column header name or the 0-based column number. |
data |
Required. A String value. The contents to be entered into the specified cell. |
Return Type
None
Example
'The following example uses the SetCellData method to modify value of the cell in the second row 'of the "Enabled" column if the value of the cell is set to "False". WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SetCellData 2, "Enabled", "False"
SetView
Description
Expands the parent rows of the specified view and makes it the current view.
Syntax
object.SetView viewPath
Arguments
Parameter | Description |
---|---|
ViewPath | Required. A Variant. The hierarchical path of the view you want to display in the format:
" Example: " Row numbers in each table are 0-based. An empty string denotes the main (top-level) view. |
Return Type
None.
IMPORTANT
A SetView "" statement (with an empty string argument) must be used before the first operation on a DevExpress Grid. When you record, this statement is added automatically for the first DevExpress Grid in your test. If your test contains steps on more than one DevExpress Grid, make sure to add a SetView"" statement before the first step on each grid.
Example
Example
'The following example uses the SetView method to set the view to the main (top-level) view.
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SetView ""
'The following example uses the SetView method to set the view to the fifth row in the "Orders" view to select
'a cell in that view. It then sets the view to the fifth row in the OrderDetails view (which is a child table
'of the Orders view) to select a cell in that view.
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SetView "4 Orders;"
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SelectCell 3, "EmployeeID"
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SetView "4 Orders;4 OrderDetails;"
WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").SelectCell 0, "ProductID"
ShowColumn
Description
Makes the specified column visible in the grid.
Syntax
object.ShowColumn columnName
Arguments
Parameter | Description |
---|---|
columnName | Required. A String. The location of the column within the grid. Specify the column header name. |
Return Type
None.
IMPORTANT
OpenText Functional Testing does not record ShowColumn steps. You can add them to your test manually.
Example
'The following example hides the WpfDXGrid's first column, 'then uses the ShowColumn method to show it. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").HideColumn 0 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").ShowColumn "Name"
ShowContextMenu Method
Description
Displays the control's context menu.
Syntax
object.ShowContextMenu
Return Type
None.
Example
'The following example opens the context menu of a WpfDXGrid and selects the 'ToolBar' item. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").ShowContextMenu WpfWindow("Controls").WpfMenu("WpfMenu").Select "ToolBar"
Type Method
Description
Types the specified string in the object.
Syntax
object.Type (KeyboardInput)
Arguments
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
KeyboardInput |
Required. A String value. The text string and/or constants representing non-alphanumeric keys. The following constants are available:
|
Return Type
None.
IMPORTANT
Although the Type method is supported for most objects, if you enter a Type statement for an object in which a user cannot enter text, the method has no visual effect.
Example
'The following example uses the Type method to type '123' in the WpfEdit object. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").Type "123"
UnGroupByColumn
Description
Ungroups data by the specified column.
Syntax
object.UnGroupByColumn columnName
Arguments
Parameter | Description |
---|---|
columnName | Required. A String. The location of the column within the grid. Specify the column header name. |
Return Type
None.
Example
'The following example groups the WpfDXGrid by the first column, then uses the 'UnGroupByColumn method to ungroup. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").GroupByColumn 0 WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").UnGroupByColumn "Name"
AutomationElement Property
Description
Accesses the native methods and properties of the AutomationElement object for the corresponding user interface object.
Syntax
object.AutomationElement
Value Type
An Object.
Property type
Read-only property
IMPORTANT
The AutomationElement property returns an object that represents a Windows Presentation Foundation UI Automation element. The returned object provides access to the common methods and properties specific to the element's control type. For more information, see the WPF Add-in section of the OpenText Functional Testing Help Center.
You can use the AutomationPattern Property to access the properties and methods provided by UI Automation for a specific instance of a Control Pattern of the element's control type.
You can use the Object Property to access the properties and methods of Windows Presentation Foundation user interface objects.
For more information, see the WPF Add-in section of the OpenText Functional Testing Help Center.
Example
'The following example uses the AutomationElement property to obtain the ClassName 'of the UI control related to the WpfDXGrid Test Object. WpfWindow("WPF DevExpress sample").WpfDXGrid("WpfDXGrid").AutomationElement.Current.ClassName
AutomationPattern Property
Description
The object that provides access to the specified Control Pattern for the run-time object.
Syntax
object.AutomationPattern (NameOrIndex)
Arguments
Parameter | Description |
---|---|
NameOrIndex |
Required. A Variant. The name or index of the Automation Pattern to access. When specifying the index, the first item in the list of supported patterns is numbered 0. |
Value Type
An Object.
Property type
Read-only property
IMPORTANT
The AutomationPattern property returns an object that provides access to a specific instance of a Control Pattern. For more information, see the WPF Add-in section of the OpenText Functional Testing Help Center.
Tip: Use the SupportedPatterns property to access a list of the currently supported patterns for the object.
You can use the AutomationElement Property to access the common methods and properties provided by UI Automation that are specific to the element's control type.
You can use the Object Property to access the properties and methods of Windows Presentation Foundation user interface objects.
For more information, see the WPF Add-in section of the OpenText Functional Testing Help Center.
SupportedPatterns Property
Description
Returns all of the currently supported patterns of the object.
Syntax
object.SupportedPatterns
Value Type
A String value.
Property type
Read-only property
IMPORTANT
A control may not always support the same set of control patterns. For example, a multiline edit box supports vertical scrolling only if the number of lines it contains exceeds its viewable area. Scrolling is disabled when enough text is removed so that scrolling is not required.
Example
'The following example uses the SupportedPatterns property to check if the ''SimpleStyles' window supports the Transform pattern. If it does, the window will 'be resized. If it does not, then an error message will be sent to the report. patterns = WpfWindow("SimpleStyles").SupportedPatterns If InStr(1, patterns, "Transform") Then WpfWindow("SimpleStyles").Resize 200, 200 Else Reporter.ReportEvent micWarning, "SimpleStyles", "The Transform pattern is not supported." End If