Skip to content

mouseAction()

Performs the given mouse action on the given coordinates. This is useful in performing actions on canvas.

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})
NameTypeDescription
actionstringAction to be performed on the canvas
coordinatesObjectCoordinates of a point on canvas to perform the action.
optionsObject
options.waitForNavigationbooleanWait for navigation after the click. Default navigation timeout is 30 seconds, to override pass { navigationTimeout: 10000 } in options parameter. Default: true.
options.navigationTimeoutnumberNavigation timeout value in milliseconds for navigation after click. Default: 30000.
options.waitForEventsArrayEvents available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: [].
options.waitForStartnumbertime to wait for navigation to start. Accepts time in milliseconds. Default: 100.
options.forcebooleanSet to true to perform action on hidden/disabled elements. Default: false.

This API does not return any values.