find(), then pick an item from the menu that opens:
element.rightClick()
Right-clicks the element at the point wherefind() located it. Itβs the same as element.click('right-click').
Errors
Throws anElementNotFoundError if find() didnβt locate the element. See click() for how to check found() first.
Right-click at coordinates
The client has norightClick() method. To right-click a point on the screen, pass action: 'right-click' to testdriver.click():
element.rightClick(), which keeps working when the layout or screen size changes.
Examples
Open a link in a new tab
Rename a file in VS Code
Complete example
tests/context-menu.test.mjs
Related
- click(): single clicks, and clicks at coordinates
- doubleClick(): open files and select words
- find(): locate the element to right-click
- Perform actions: every kind of action in one guide

