_<<Ref328523447, ClickSubItem >>_
This topic provides reference information about the methods for mouse action emulation on Infragistics controls.
This topic contains the following sections:
The following table maps the supported user mouse actions to the Test Automation methods that emulate them. Some actions are supported by two methods depending on whether the action is performed on the entire control, for example, on the whole grid, or on some of its parts, like a cell of the grid. (See Mouse Action Emulation Methods Summary.)
The following table briefly explains the methods for emulating user mouse actions. The Operation level column of the table indicates whether the method operates on the control as a whole, at the control operational level, for example, on the whole grid, or on some of its parts (sub-item operational level), for example, a cell of the grid. Detailed information about the methods is provided in the text blocks following the table.
The accessibility of each method is specific to the control that is calling the method. For details, please refer to the documentation of the respective control, the Testable User Actions and Elements topic.
The ClickControl method performs a left-click on the control.
All Infragistics controls.
The following table explains the method’s parameters.
The following image presents the mouse click locations used in the examples. The size of the xamGeographicMap control is 1000x1000 pixels. The ClickControl parameters are shown in blue, and the location’s x-,y-coordinates – in black.
Example 1
Clicking at the x-y coordinates (200,305) on the xamDataChart :
WpfWindow("MainWindow").XamDataChart("chart").ClickControl igAt, 200, 305 Example 2
Clicking the top right corner of the xamGeographicMap :
WpfWindow("MainWindow").XamGeographicMap("map").ClickControl igTopRight Example 3
Clicking a point 200 pixels inside the top right corner of a 1000x1000 xamGeographicMap :
WpfWindow("MainWindow").XamGeographicMap("map").ClickControl igTopRight, 200 Example 4
Clicking the middle of the xamGeographicMap :
WpfWindow("MainWindow").XamGeographicMap("map").ClickControl igMidCenter Example 5
Clicking a point 100 pixels diagonally away from the middle (toward the upper left corner) on a 1000x1000 xamGeographicMap :WpfWindow("MainWindow").XamGeographicMap("map").ClickControl igMidCenter, 100
Example 6
Clicking a point 20% from the left margin and 50% from the top of the xamGeographicMap :
WpfWindow("MainWindow").XamGeographicMap("map").ClickControl igTopRight
The ClickSubItem method emulates a mouse click on a control’s specific sub-item.
xamDataCards
xamDataCarousel
xamDataGrid
The following table explains the method’s parameters.
Clicking a grid cell to toggle the checked state of a checkbox in the cell.
In this example, the oeSubItemType parameter value is gridCell and the oSubItem parameter value is the string, {5}[ForSale], which specifies the row by index and the column by key.
WpfWindow("MainWindow").XamDataGrid("grid").ClickSubItem gridCell,"{5}[ForSale]",igMidCenter
(Refer to Illustration above.)
The DblClickControl method performs a double-click action on the control.
All Infragistics controls.
The DblClickControl method has the same parameters as the ClickControl.
The DblClickSubItem method performs a double-click on a sub-item of the control.
xamDataPresenter
xamDataCards
xamDataCarousel
xamDataGrid
xamGrid
The DblClickSubItem method has the same parameters as the ClickSubItem.
The MouseActionOnControl method performs the following mouse actions on a specified location on the control:
Left-click
Double-click
Right-click
Mouse down
Mouse up
Mouse move
As the MouseActionOnControl method supports several different mouse actions, the exact action to perform is specified with a parameter. (For details, see Parameters.)
All Infragistics controls.
The following table explains the method’s parameters.
Replaying a user’s dragging the mouse to zoom action into the xamDataChart . The zoom rectangle, generated by this move starts 10 pixels above and to the left of the middle of the chart and ends 50 pixels above and to the left of the bottom right corner.
Set chart=WpfWindow("MainWindow").XamDataChart("chart1")
chart1.MouseActionOnControl igMouseDown, igMidCenter, -10
chart1.MouseActionOnControl igMouseMove, igBottomRight, 50
The MouseActionOnSubItem method performs the following mouse actions on a sub-item of the specified control:
Left-click
Double-click
Right-click
Mouse down
Mouse up
Mouse move
As the MouseActionOnSubItem method supports several different mouse actions, the exact action to perform is specified with a parameter. (For details, see Parameters.)
xamDataPresenter
xamDataCards
xamDataCarousel
xamDataGrid
xamGrid
The following table explains the method’s parameters.
This example demonstrates how to emulate a drag-drop operation that moves a tree node Tonka from one xamDataTree to another.
In the example, there are three calls specifying igMouseMove. While it is not always necessary to implement all three calls, this is the recommended approach. Your actual requirements vary depending on how the application itself implements the drag-drop function. The following is the recommended approach, using three calls:
one igMouseMove call inside the source sub-item, at a point differing by at least 3 pixels from the starting point
one igMouseMove call external to the source sub-item, but inside the starting control
one igMouseMove call inside the target sub-item, but differing from the end point by at least three pixels
Set left_tree = WpfWindow("MainWindow").XamDataTree("xamTree1")
Set right_tree = WpfWindow("MainWindow").XamDataTree("xamTree2")
left_tree.MouseActionOnSubItem igMouseDown,treeNode, ARRAY("WDJohnson", "Tonka")
left_tree.MouseActionOnSubItem igMouseMove,treeNode, ARRAY("WDJohnson", "Tonka"),igMidCenter,5
left_tree.MouseActionOnControl igMouseMove,igMidRight
right_tree.MouseActionOnSubItem igMouseMove,treeNode, ARRAY("CityWide", "BMW"),igTopCenter,3
right_tree.MouseActionOnSubItem igMouseUp,treeNode, ARRAY("CityWide", "BMW") ,igTopCenter
The RightClickControl method performs a right-click on the control.
All Infragistics controls.
The RightClickControl method has the same parameters as the ClickControl.
The RightClickSubItem method performs a right-click on a sub-item of the control.
xamDataPresenter
xamDataCards
xamDataCarousel
xamDataGrid
xamGrid
The RightClickSubItem method has the same parameters as the ClickSubItem.
The following topics provide additional information related to this topic.