MouseMove

Provides functionality to move the mouse cursor to elements or specific positions on a web page.

Classes

MouseMove

Methods

(async) byOffset(xOffset, yOffset) → {Promise.<void>}

Moves the mouse cursor by an offset from its current position.
Parameters:
NameTypeDescription
xOffsetnumberThe x offset to move by.
yOffsetnumberThe y offset to move by.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the mouse has moved by the specified offset.
Type: 
Promise.<void>

(async) bySelector(selector) → {Promise.<void>}

Moves the mouse cursor to an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to move to.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the element.
Type: 
Promise.<void>

(async) byXpath(xpath) → {Promise.<void>}

Moves the mouse cursor to an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to move to.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the element.
Type: 
Promise.<void>

(async) toPosition(xPos, yPos) → {Promise.<void>}

Moves the mouse cursor to a specific position on the screen.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen to move to.
yPosnumberThe y-coordinate on the screen to move to.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the mouse has moved to the specified position.
Type: 
Promise.<void>