Skip to content

PointerInputDevice

This is a JavaScript wrapper for PointerInputDevice of Selenium .NET library. Use WebDriver.CreatePointerInput or AppiumDriver.CreatePointerInput to create an instance of PointerInputDevice.

var p = WebDriver.CreatePointerInput("Mouse", "pointer");
// or
var p = AppiumDriver.CreatePointerInput("Touch", "finger");
// p is used in examples below to refer to an instance of PointerInputDevice.

Action Summary

Action Description
CreateActionSequence Creates new action sequence.
CreatePause Creates pause action.
CreatePointerCancel Creates pointer cancel action.
CreatePointerDown Creates pointer down action.
CreatePointerMove Creates pointer move action.
CreatePointerMoveElement Creates pointer move action.
CreatePointerUp Creates pointer up action.

Action Detail

CreateActionSequence

Creates new action sequence. See ActionSequence.

p.CreateActionSequence(p);

Returns:

ActionSequence object.

CreatePause

Creates pause action.

p.CreatePause(duration)

Parameters:

Name Type Description
duration number Pause duration in milliseconds.

Returns:

Interaction object to add to ActionSequence.

CreatePointerCancel

Creates pointer cancel action.

p.CreatePointerCancel()

Returns:

Interaction object to add to ActionSequence.

CreatePointerDown

Creates pointer down action.

p.CreatePointerDown(button)

Parameters:

Name Type Description
button string Touch, Left, Middle or Right

Returns:

Interaction object to add to ActionSequence.

CreatePointerMove

Creates pointer move action.

p.CreatePointerMove(origin, xOffset, yOffset, duration)

Parameters:

Name Type Description
origin string Viewport, Pointer
xOffset number X-coordinate offset from top-left corner of the origin.
yOffset number Y-coordinate offset from top-left corner of the origin.
duration number Move duration in milliseconds.

Returns:

Interaction object to add to ActionSequence.

CreatePointerMoveElement

Creates pointer move action.

p.CreatePointerMoveElement(target, xOffset, yOffset, duration)

Parameters:

Name Type Description
target AppiumWebElement Target element.
xOffset number X-coordinate offset from top-left corner of the target.
yOffset number Y-coordinate offset from top-left corner of the target.
duration number Move duration in milliseconds.

Returns:

Interaction object to add to ActionSequence.

CreatePointerUp

Creates pointer up action.

p.CreatePointerUp(button)

Parameters:

Name Type Description
button string Touch, Left, Middle or Right

Returns:

Interaction object to add to ActionSequence.