testdriverinteracting-with-your-applisted
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from interacting-with-your-app.mdx. DO NOT EDIT. -->
## Overview
Once you've [located an element](/locating-elements), the `Element` object exposes methods to interact with it. Use these to click, hover, and perform mouse operations that drive your app.
## Interaction Methods
#### click()
Click on the element.
```javascript
await element.click(action)
```
**Parameters:**
- `action` (string, optional) - Type of click: `'click'` (default), `'double-click'`, `'right-click'`, `'hover'`, `'mouseDown'`, `'mouseUp'`
**Returns:** `Promise<void>`
**Example:**
```javascript
const button = await testdriver.find('submit button');
await button.click(); // Regular click
const file = await testdriver.find('document.txt');
await file.click('double-click'); // Double-click
const menu = await testdriver.find('settings icon');
await menu.click('right-click'); // Right-click
```
<Note>
The element must be found before clicking. The `find()` method automatically locates the element.
</Note>
#### hover()
Hover over the element without clicking.
```javascript
await element.hover()
```
**Returns:** `Promise<void>`
**Example:**
```javascript
const tooltip = await testdriver.find('info icon');
await tooltip.hover();
// Wait to see tooltip
await new Promise(resolve => setTimeout(resolve, 1000));
```
#### doubleClick()
Double-click on the element.
```javascript
await element.doubleClick()
```
**Returns:** `Promise<void>`
**Example:**
```javascript
const file = awai