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
Use Cases
Opening Files
Opening Files
Drag and Drop
Drag and Drop
Complete Example
Related Methods
find()- Find elements to clickhover()- Put the cursor on the element without a clickdoubleClick()- The double-click methodrightClick()- The right-click method

