Comment on page
TesterMouseExtensions Methods
Clicks at the specified x, y offset from the current position. Used e.g. to click out of text box.
public static void ClickRelativeToCurrentPosition(
this IMouse mouse,
ITester t,
int x,
int y,
MouseButton button = MouseButton.Left
)
Parameter | Description |
mouse | |
t | |
x | |
y | |
[button] | The mouse button that shall be used for the click. |
Performs a double click at the specified target location. Wait time between the individual clicks is controlled by the optional parameter doubleClickDelay.
public static void DoubleClick(
this IMouse mouse,
ITester t,
Point target,
int doubleClickDelay = 20,
MouseButton mouseButton = MouseButton.Left
)
Parameter | Description |
mouse | |
t | |
target | Position where to click with the mouse. |
[doubleClickDelay] | |
[button] | The mouse button that shall be used for the clicks. |
Performs a drag-and-drop movement from the origin point to the target point.
Mouse is moved to the origin first, then the mouse button is pressed and the mouse is moved to the target point. After the move it waits until the screen is stable again in the area specified by filters (movement animation is finished) and the mouse button is released.
The caller is responsible to wait for any animation to complete which happens after the mouse button is released.
public static void DragAndDrop(
this IMouse mouse,
ITester t,
Point origin,
Point target,
MouseButton mouseButton = MouseButton.Left,
ImgDiffTolerance imgDiffTolerance = ImgDiffTolerance.Low,
params IImageFilter[] filters
)
Parameter | Description |
mouse | |
t | |
origin | Position where to press the mouse button and start the drag and drop. |
target | Position where to move the mouse and release the mouse button. |
[button] | The mouse button that shall be used for the drag and drop. |
[imgDiffTolerance] | Type: ImgDiffTolerance
The tolerance that is used to wait for stable screen after completing the move before the mouse button is released. |
[filters] | Type: IImageFilter[ ]
Typically a Select filter indicating the area that is checked when waiting for the stable screen. |
Performs a long click which lasts for delayInMs, instead of the usual t.Properties.MouseClickDelay.
public static void LongClick(
this IMouse mouse,
ITester t,
Point target,
int delayInMs,
MouseButton mouseButton = MouseButton.Left
)
Parameter | Description |
mouse | |
t | |
target | Position where to click with the mouse. |
delayInMs | |
[button] | The mouse button that shall be used for the click. |
Performs a triple click at the specified target location. Wait time between the individual clicks is controlled by the optional parameter doubleClickDelay.
public static void TripleClick(
this IMouse mouse,
ITester t,
Point target,
int doubleClickDelay = 20,
MouseButton mouseButton = MouseButton.Left
)
Parameter | Description |
mouse | |
t | |
target | Position where to click with the mouse. |
[doubleClickDelay] | |
[button] | The mouse button that shall be used for the clicks. |
Last modified 3yr ago