Classes
Methods
(async) byOffset(xOffset, yOffset) → {Promise.<void>}
Moves the mouse cursor by an offset from its current position.
Parameters:
Name | Type | Description |
---|---|---|
xOffset | number | The x offset to move by. |
yOffset | number | The 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:
Name | Type | Description |
---|---|---|
selector | string | The 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:
Name | Type | Description |
---|---|---|
xpath | string | The 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:
Name | Type | Description |
---|---|---|
xPos | number | The x-coordinate on the screen to move to. |
yPos | number | The 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>