Skip to main content

Element Click

When called on an Element object, clicks on the located element.

Syntax

Parameters

string
default:"click"
Type of click action: 'click', 'double-click', 'right-click', 'hover', 'mouseDown', 'mouseUp'

Returns

Promise<void>

Examples

Coordinate Click

Click at specific screen coordinates.

Syntax

Parameters

number
required
X coordinate
number
required
Y coordinate
string
default:"click"
Type of click: 'click', 'double-click', 'right-click', 'mouseDown', 'mouseUp'

Returns

Promise<void>

Examples

Click Actions

Regular Click

Single left-click action.

Double Click

Double-click action, commonly used to open files or select text.

Right Click

Right-click to open context menus.

Mouse Down / Mouse Up

For drag operations or custom click behavior.

Best Practices

Prefer element clicks over coordinate clicksElement-based clicking is more reliable and resolution-independent:
Verify element was found
Element must be found before clickingThe find() method automatically locates elements, but clicking an element that wasn’t found will throw an error:

Use Cases

Complete Example