testdriverright-clicklisted
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from right-click.mdx. DO NOT EDIT. -->
## Overview
The `rightClick()` method performs a right-click action on an element, typically used to open context menus. You can either call it on an [`Element`](/v7/core-concepts/elements) instance or use it directly with a selector.
## Syntax
```javascript
// Right-click on an element
await element.rightClick();
// Right-click using a selector
await ai.rightClick('selector');
```
## Parameters
When called on an `Element`, 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 a `Promise<void>` that resolves when the right-click action completes.
## Examples
### Right-Click to Open Context Menu
```javascript
const fileItem = await ai.find('README.md file');
await fileItem.rightClick();
// Select menu option
await ai.click('Delete from context menu');
```
### Direct Right-Click with Selector
```javascript
await ai.rightClick('image in the gallery');
await ai.click('Save image as');
```
### VS Code Context Menu
```javascript
import { test } from 'vitest';
import { vscode } from '@testdriver/sdk';
test('renames a file via context menu', async () => {
const { ai } = await vscode();
// Right-click on a file
await ai.rightClick('test.js in the file explorer');
// Click rename option
await ai.click('Rename');
//