find():
find():
element.click(action)
Clicks the element at the point wherefind() located it.
Parameters
ClickAction
default:"click"
The mouse action to perform:
'click': a left click'double-click': a double click, same asdoubleClick()'right-click': a right click, same asrightClick()'hover': move the mouse there without clicking, same ashover()'mouseDown'and'mouseUp': press or release the button, for dragging. See mouseDown().
Errors
Throws anElementNotFoundError if find() didn’t locate the element. Check found() first when the element might not be there:
testdriver.click(options)
Clicks a point on the screen by its coordinates. Preferelement.click(), which keeps working when the layout or screen size changes.
Parameters
object
required
The older form
testdriver.click(x, y, action) still works. Use the options object in new tests.Examples
Open a context menu
Open a file
Drag an item
Complete example
tests/login.test.mjs
Related
- find(): locate the element to click
- doubleClick(), rightClick(), and hover(): shortcuts for the other actions
- mouseDown() and mouseUp(): drag and drop
- Perform actions: every kind of action in one guide

