ClickAndHold

Provides functionality to click and hold elements on a web page using different strategies.

Classes

ClickAndHold

Methods

(async) atCursor() → {Promise.<void>}

Clicks and holds at the current cursor position.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

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

Clicks and holds at the specified screen coordinates.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen.
yPosnumberThe y-coordinate on the screen.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

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

Clicks and holds on an element that matches a given CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to interact with.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

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

Clicks and holds on an element that matches a given XPath selector.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to interact with.
Throws:
Throws an error if the element is not found.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

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

Releases the mouse button at the specified screen coordinates.
Parameters:
NameTypeDescription
xPosnumberThe x-coordinate on the screen.
yPosnumberThe y-coordinate on the screen.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

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

Releases the mouse button on an element matching the specified CSS selector.
Parameters:
NameTypeDescription
selectorstringThe CSS selector of the element to release the mouse on.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>

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

Releases the mouse button on an element matching the specified XPath.
Parameters:
NameTypeDescription
xpathstringThe XPath selector of the element to release the mouse on.
Throws:
Throws an error if the action cannot be performed.
Type
Error
Returns:
A promise that resolves when the action is performed.
Type: 
Promise.<void>