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

t

x

y

[button]

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

t

target

Position where to click with the mouse.

[doubleClickDelay]

[button]

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

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]

[filters]

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

t

target

Position where to click with the mouse.

delayInMs

[button]

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

t

target

Position where to click with the mouse.

[doubleClickDelay]

[button]

The mouse button that shall be used for the clicks.

Last updated