Overview
Interaction commands allow you to simulate user interactions with page elements.Mouse Interactions
click
Click an element.| Parameter | Description |
|---|---|
selector | CSS selector, ref (@e1), or text locator |
| Option | Description |
|---|---|
—new-tab | Open link in new tab |
dblclick
Double-click an element.| Parameter | Description |
|---|---|
selector | Element selector |
hover
Hover over an element.| Parameter | Description |
|---|---|
selector | Element selector |
focus
Focus an element.| Parameter | Description |
|---|---|
selector | Element selector |
Text Input
fill
Clear and fill an input field.| Parameter | Description |
|---|---|
selector | Input element selector |
text | Text to fill (multiple words joined with spaces) |
type
Type text into an element (without clearing).| Parameter | Description |
|---|---|
selector | Input element selector |
text | Text to type |
press
Press a keyboard key.| Parameter | Description |
|---|---|
key | Key name (Enter, Tab, Escape) or key combination (Control+a) |
key
Examples:
keyboard type
Type text with real keystrokes (current focus).| Parameter | Description |
|---|---|
text | Text to type |
keyboard inserttext
Insert text without key events (current focus).| Parameter | Description |
|---|---|
text | Text to insert |
Form Controls
check
Check a checkbox.| Parameter | Description |
|---|---|
selector | Checkbox selector |
uncheck
Uncheck a checkbox.| Parameter | Description |
|---|---|
selector | Checkbox selector |
select
Select dropdown option(s).| Parameter | Description |
|---|---|
selector | Select element selector |
value | Option value(s) to select |
Scrolling
scroll
Scroll the page or an element.| Parameter | Description |
|---|---|
direction | Direction: up, down, left, right (default: down) |
amount | Pixels to scroll (default: 300) |
| Option | Description |
|---|---|
-s, —selector | Scroll specific element instead of page |
scrollintoview
Scroll element into view.| Parameter | Description |
|---|---|
selector | Element selector |
scrollinto
Examples:
Drag and Drop
drag
Drag an element to another element.| Parameter | Description |
|---|---|
source | Source element selector |
target | Target element selector |
File Upload
upload
Upload file(s) to an input element.| Parameter | Description |
|---|---|
selector | File input selector |
files | File path(s) to upload |