Overview
TherightClick() method performs a right-click action on an element, typically used to open context menus. You can either call it on an Element instance or use it directly with a selector.
Syntax
Parameters
When called on anElement, no parameters are required.
When called directly on the AI client:
| Parameter | Type | Description |
|---|---|---|
selector | string | The selector describing the element to right-click |
Returns
Returns aPromise<void> that resolves when the right-click action completes.
Examples
Right-Click to Open Context Menu
Direct Right-Click with Selector
VS Code Context Menu
Browser Context Menu
Custom Context Menu in Web App
Related Methods
click()- Single click on an elementdoubleClick()- Double-click on an elementmouseDown()- Press mouse button without releasingmouseUp()- Release mouse buttonhover()- Move mouse over element without clicking

