mouseAction()
Performs the given mouse action on the given coordinates. This is useful in performing actions on canvas.
Examples
await mouseAction('press', {x:0,y:0})
await mouseAction('move', {x:9,y:9})
await mouseAction('release', {x:9,y:9})
await mouseAction($("#elementID"),'press', {x:0,y:0})
await mouseAction($(".elementClass"),'move', {x:9,y:9})
await mouseAction($("testxpath"),'release', {x:9,y:9})
await mouseAction('release', {x:9, y:9}, {navigationTimeout: 30000})
Parameters
| Name | Type | Description |
|---|---|---|
action |
string | Action to be performed on the canvas |
coordinates |
Object | Coordinates of a point on canvas to perform the action. |
options |
Object | |
options.waitForNavigation |
boolean | Wait for navigation after the click. Default navigation timeout is 30 seconds, to override pass { navigationTimeout: 10000 } in options parameter. Default: true. |
options.navigationTimeout |
number | Navigation timeout value in milliseconds for navigation after click. Default: 30000. |
options.waitForEvents |
Array | Events available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: []. |
options.waitForStart |
number | time to wait for navigation to start. Accepts time in milliseconds. Default: 100. |
options.force |
boolean | Set to true to perform action on hidden/disabled elements. Default: false. |
Returns
This API does not return any values.