TesterMouseExtensions Methods

ClickRelativeToCurrentPosition

Clicks at the specified x, y offset from the current position. Used e.g. to click out of text box.

Syntax:

public static void ClickRelativeToCurrentPosition(
	this IMouse mouse,
	ITester t,
	int x,
	int y,
	MouseButton button = MouseButton.Left
)

Parameters:

Parameter

Description

mouse

Type: IMouse The IMouse interface on which the extension is called.

t

Type: ITester The ITester interface.

x

Type: Int32 The offset in x-Direction (left-right).

y

Type: Int32 The offset in y-Direction (up-down).

[button]

Type: MouseButton

The mouse button that shall be used for the click.

DoubleClick

Performs a double click at the specified target location. Wait time between the individual clicks is controlled by the optional parameter doubleClickDelay.

Syntax:

public static void DoubleClick(
	this IMouse mouse,
	ITester t,
	Point target,
	int doubleClickDelay = 20,
	MouseButton mouseButton = MouseButton.Left
)

Parameters:

Parameter

Description

mouse

Type: IMouse The IMouse interface on which the extension is called.

t

Type: ITester The ITester interface.

target

Type: Point

Position where to click with the mouse.

[doubleClickDelay]

Type: Int32 The time to wait between the clicks.

[button]

Type: MouseButton

The mouse button that shall be used for the clicks.

DragAndDrop

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.

Syntax:

public static void DragAndDrop(
	this IMouse mouse,
	ITester t,
	Point origin,
	Point target,
	MouseButton mouseButton = MouseButton.Left,
	ImgDiffTolerance imgDiffTolerance = ImgDiffTolerance.Low,
	params IImageFilter[] filters
)

Parameters:

Parameter

Description

mouse

Type: IMouse The IMouse interface on which the extension is called.

t

Type: ITester The ITester interface.

origin

Type: Point

Position where to press the mouse button and start the drag and drop.

target

Type: Point

Position where to move the mouse and release the mouse button.

[button]

Type: MouseButton

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.

LongClick

Performs a long click which lasts for delayInMs, instead of the usual t.Properties.MouseClickDelay.

Syntax:

public static void LongClick(
	this IMouse mouse,
	ITester t,
	Point target,
	int delayInMs,
	MouseButton mouseButton = MouseButton.Left
)

Parameters:

Parameter

Description

mouse

Type: IMouse The IMouse interface on which the extension is called.

t

Type: ITester The ITester interface.

target

Type: Point

Position where to click with the mouse.

delayInMs

Type: Int32 How long the click shall last in milliseconds.

[button]

Type: MouseButton

The mouse button that shall be used for the click.

TripleClick

Performs a triple click at the specified target location. Wait time between the individual clicks is controlled by the optional parameter doubleClickDelay.

Syntax:

public static void TripleClick(
	this IMouse mouse,
	ITester t,
	Point target,
	int doubleClickDelay = 20,
	MouseButton mouseButton = MouseButton.Left
)

Parameters:

Parameter

Description

mouse

Type: IMouse The IMouse interface on which the extension is called.

t

Type: ITester The ITester interface.

target

Type: Point

Position where to click with the mouse.

[doubleClickDelay]

Type: Int32 The time to wait between the clicks.

[button]

Type: MouseButton

The mouse button that shall be used for the clicks.

Last updated