Skip to main content

Element Click

When you call this on an Element object, it clicks on the found 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

One left-click action.

Double Click

A double-click action. It usually opens files or selects text.

Right Click

Right-click to open context menus.

Mouse Down / Mouse Up

Use these for drag operations or custom click behavior.

Best Practices

Prefer element clicks to coordinate clicksA click on an element is more reliable. It does not depend on the resolution:
Make sure that TestDriver found the element
TestDriver must find the element before you click itThe find() method finds elements automatically. But a click on an element that TestDriver did not find throws an error:

Use Cases

Complete Example