Taiko
Documentation

Home / API Reference

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})

Parameters


action

Action to be performed on the canvas


coordinates

Coordinates of a point on canvas to perform the action.


options

options.waitForNavigation boolean

Wait for navigation after the click. Default navigation timeout is 30 seconds, to override pass { navigationTimeout: 10000 } in options parameter.

Default value
true

options.navigationTimeout number

Navigation timeout value in milliseconds for navigation after click.

Default value
30000

options.waitForEvents

Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint']

Default value
['firstMeaningfulPaint']

options.waitForStart number

time to wait for navigation to start. Accepts time in milliseconds.

Default value
100

Returns

This API does not return any values