Interaction Commands
Interaction commands allow you to interact with elements on a web page: clicking buttons, filling forms, selecting options, hovering over elements, scrolling, and more. These commands are the workhorses of web automation.
Clicks an element on the page.
Description
Section titled “Description”The click command simulates a mouse click on a specific element. This is the most commonly used interaction command, as most web interactions involve clicking buttons, links, or other elements.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element to click. Format: css=..., xpath=..., or text=.... |
button |
String | No | "left" |
The mouse button to use. Options: left, right, middle. |
click_count |
Number | No | 1 |
The number of clicks. Use 2 for double-click. |
force |
Boolean | No | false |
Force the click even if the element is obscured by other elements. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
position |
Object | No | null |
The position to click relative to the element. Format: {x: number, y: number}. |
modifiers |
Array | No | [] |
Keyboard modifiers to hold during the click. Options: Alt, Control, Meta, Shift. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element to be clickable. |
Example
Section titled “Example”{ "command": "click", "params": { "selector": "css=button.submit", "button": "left", "click_count": 1 }}Double-click example:
{ "command": "click", "params": { "selector": "css=.product-card", "click_count": 2 }}Right-click example:
{ "command": "click", "params": { "selector": "css=.context-menu-target", "button": "right" }}Humanoid Behavior
Section titled “Humanoid Behavior”When humanoid behavior is enabled (default), the click command:
- Scrolls the element into view if needed.
- Calculates the element’s center position with slight randomization.
- Moves the mouse to the element using a Bezier curve path (simulating human movement).
- Adds a random delay before clicking (simulating human hesitation).
- Performs the click.
- Adds a random delay after clicking.
The sensitivity level (low, medium, high) controls how much randomization is applied.
- Use
force: trueif the element is obscured by overlays or popups. - Use
positionto click a specific part of an element (e.g., the right side of a button). - Use
modifiersto simulate keyboard shortcuts (e.g.,Control+ click to open in a new tab).
Fills an input element with text.
Description
Section titled “Description”The fill command sets the value of an input element. This is faster than type because it sets the value directly rather than simulating keystrokes.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the input element. |
value |
String | Yes | — | The text to fill. Supports ${variable} substitution. |
clear_before_fill |
Boolean | No | true |
Clear existing text before filling. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "fill", "params": { "selector": "css=input[name='email']", "value": "user@example.com", "clear_before_fill": true }}With variable substitution:
{ "command": "fill", "params": { "selector": "css=input[name='search']", "value": "${search_term}" }}Humanoid Behavior
Section titled “Humanoid Behavior”When humanoid behavior is enabled, the fill command:
- Scrolls the element into view.
- Moves the mouse to the element using a Bezier curve.
- Clicks the element to focus it.
- Types the text character by character with random delays between keystrokes.
- Use
fillfor simple text input. Usetypeif you need to simulate keystrokes (e.g., for autocomplete). - Set
clear_before_fill: falseif you want to append text to existing content.
Types text sequentially into an element, simulating real user keystrokes.
Description
Section titled “Description”The type command simulates typing text character by character, with optional delays between keystrokes. This is more realistic than fill and is useful for triggering autocomplete or other keyboard-driven interactions.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the input element. |
text |
String | Yes | — | The text to type. Supports ${variable} substitution. |
delay |
Number (ms) | No | 0 |
Delay between keystrokes in milliseconds. |
clear |
Boolean | No | false |
Clear existing text before typing. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "type", "params": { "selector": "css=input[name='search']", "text": "wireless headphones", "delay": 100, "clear": true }}Humanoid Behavior
Section titled “Humanoid Behavior”When humanoid behavior is enabled, the type command adds random delays between keystrokes on top of the specified delay parameter, making the typing even more human-like.
- Use
typeinstead offillwhen you need to trigger autocomplete or other keyboard-driven interactions. - Set
delayto a value between 50-200ms for realistic typing speed. - Set
clear: trueif you want to clear existing text before typing.
Simulates a key press on an element.
Description
Section titled “Description”The press command simulates pressing a keyboard key on a specific element. This is useful for pressing Enter, Tab, Escape, or other special keys.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element. |
key |
String | Yes | "Enter" |
The key to press (e.g., Enter, Tab, Escape, ArrowDown). |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "press", "params": { "selector": "css=input[name='search']", "key": "Enter" }}Common Keys
Section titled “Common Keys”| Key | Description |
|---|---|
Enter |
Press the Enter key |
Tab |
Press the Tab key |
Escape |
Press the Escape key |
ArrowUp, ArrowDown, ArrowLeft, ArrowRight |
Arrow keys |
Backspace |
Press the Backspace key |
Delete |
Press the Delete key |
PageUp, PageDown |
Page navigation keys |
Home, End |
Home and End keys |
- Use
pressafterfillortypeto submit a form (e.g., press Enter after filling a search box). - Use
Tabto navigate between form fields. - Use
Escapeto close modals or popups.
keyboard
Section titled “keyboard”Simulates a keyboard action with optional delay.
Description
Section titled “Description”The keyboard command is similar to press but with an optional delay parameter. It simulates a keyboard action on a specific element.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element. |
key |
String | Yes | "Enter" |
The key to press. |
delay |
Number (ms) | No | 0 |
Delay before the key press in milliseconds. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "keyboard", "params": { "selector": "css=input[name='search']", "key": "Enter", "delay": 500 }}- Use
keyboardinstead ofpresswhen you need a delay before the key press. - Use
delayto simulate human hesitation before pressing a key.
Checks a checkbox or radio button.
Description
Section titled “Description”The check command checks a checkbox or selects a radio button. If the element is already checked, the command does nothing.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the checkbox or radio button. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "check", "params": { "selector": "css=input[name='agree_terms']" }}Humanoid Behavior
Section titled “Humanoid Behavior”When humanoid behavior is enabled, the check command:
- Scrolls the element into view.
- Moves the mouse to the element using a Bezier curve.
- Clicks the element to check it.
- Use
checkfor checkboxes and radio buttons. - If the element is already checked, the command does nothing (no error is thrown).
uncheck
Section titled “uncheck”Unchecks a checkbox.
Description
Section titled “Description”The uncheck command unchecks a checkbox. If the element is already unchecked, the command does nothing.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the checkbox. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "uncheck", "params": { "selector": "css=input[name='newsletter']" }}- Use
uncheckto uncheck checkboxes. - If the element is already unchecked, the command does nothing (no error is thrown).
select_option
Section titled “select_option”Selects an option in a dropdown (<select>) element.
Description
Section titled “Description”The select_option command selects an option in a dropdown (<select>) element. You can select by value, label, or index.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the <select> element. |
value |
String | Yes | — | The value of the option to select. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "select_option", "params": { "selector": "css=select[name='country']", "value": "us" }}Humanoid Behavior
Section titled “Humanoid Behavior”When humanoid behavior is enabled, the select_option command:
- Scrolls the element into view.
- Moves the mouse to the element using a Bezier curve.
- Clicks the element to open the dropdown.
- Selects the specified option.
- Use the
valueattribute of the<option>element, not the visible text. - If you need to select by visible text, use
text=selector format.
Hovers the mouse over an element.
Description
Section titled “Description”The hover command moves the mouse over an element without clicking it. This is useful for triggering hover-based interactions like dropdown menus or tooltips.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "hover", "params": { "selector": "css=.dropdown-menu-trigger" }}Humanoid Behavior
Section titled “Humanoid Behavior”When humanoid behavior is enabled, the hover command:
- Scrolls the element into view.
- Moves the mouse to the element using a Bezier curve.
- Adds a random delay to simulate human hesitation.
- Use
hoverto trigger dropdown menus or tooltips. - Add a
waitcommand afterhoverif you need to wait for the hover effect to complete.
Focuses an element.
Description
Section titled “Description”The focus command gives keyboard focus to an element. This is useful for triggering focus-based interactions or preparing an element for keyboard input.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "focus", "params": { "selector": "css=input[name='search']" }}- Use
focusbeforepressorkeyboardto ensure the element has keyboard focus. - Use
focusto trigger focus-based interactions like autocomplete.
scroll
Section titled “scroll”Performs advanced scrolling actions.
Description
Section titled “Description”The scroll command scrolls the page or a specific element. You can scroll to the bottom, top, or by a specific number of pixels.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | No | "" |
The selector for the element to scroll. Leave empty to scroll the window. |
direction |
String | No | "bottom" |
The scroll direction. Options: bottom, top, by_pixels. |
amount |
Number | No | 0 |
The number of pixels to scroll (for by_pixels direction). |
smooth |
Boolean | No | false |
Use smooth scrolling animation. |
delay |
Number (ms) | No | 1000 |
Delay after scrolling in milliseconds. |
repeats |
Number | No | 1 |
The number of times to repeat the scroll. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
Example
Section titled “Example”Scroll to the bottom of the page:
{ "command": "scroll", "params": { "direction": "bottom", "smooth": true, "delay": 1000 }}Scroll a specific element by pixels:
{ "command": "scroll", "params": { "selector": "css=.scrollable-container", "direction": "by_pixels", "amount": 500, "repeats": 3 }}- Use
smooth: truefor realistic scrolling animation. - Use
repeatsto scroll multiple times (useful for infinite scroll). - Use
delayto wait for content to load after scrolling.
scroll_into_view
Section titled “scroll_into_view”Scrolls an element into the viewport.
Description
Section titled “Description”The scroll_into_view command scrolls the page until a specific element is visible in the viewport. This is useful for interacting with elements that are below the fold.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "scroll_into_view", "params": { "selector": "css=.load-more-button" }}Humanoid Behavior
Section titled “Humanoid Behavior”When humanoid behavior is enabled, the scroll_into_view command uses smooth scrolling to bring the element into view.
- Use
scroll_into_viewbefore interacting with elements that are below the fold. - Most interaction commands (click, fill, etc.) automatically scroll elements into view, so you may not need this command explicitly.
drag_to
Section titled “drag_to”Drags an element to a target element.
Description
Section titled “Description”The drag_to command simulates dragging an element from one location to another. This is useful for drag-and-drop interactions.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source_selector |
String | Yes | — | The selector for the element to drag. |
target_selector |
String | Yes | — | The selector for the target element. |
source_position |
Object | No | null |
The position to start dragging from, relative to the source element. Format: {x: number, y: number}. |
target_position |
Object | No | null |
The position to drop at, relative to the target element. Format: {x: number, y: number}. |
iframe |
String | No | "" |
The selector for the iframe containing the elements. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the elements. |
Example
Section titled “Example”{ "command": "drag_to", "params": { "source_selector": "css=.draggable-item", "target_selector": "css=.drop-zone" }}- Use
source_positionandtarget_positionto control the exact drag start and drop positions. - If the drag doesn’t work, try adding a
waitcommand before the drag to ensure the elements are fully loaded.
select_text
Section titled “select_text”Selects the text content of an element.
Description
Section titled “Description”The select_text command selects the text content of an element, similar to highlighting text with the mouse.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "select_text", "params": { "selector": "css=.article-content" }}- Use
select_textto select text for copying or other text-based operations. - Use
presswithControl+Cafterselect_textto copy the selected text.
set_input_files
Section titled “set_input_files”Selects files for a file input element, preparing them for upload.
Description
Section titled “Description”The set_input_files command selects files for a file input element, preparing them for upload. This is useful for automating file upload forms.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the file input element. |
paths |
String | Yes | "file.txt" |
The file path(s) to select. Multiple files can be specified as a comma-separated list. |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "set_input_files", "params": { "selector": "css=input[type='file']", "paths": "/path/to/file.pdf" }}- Use absolute file paths for reliability.
- Multiple files can be specified as a comma-separated list.
- The file must exist on the local file system.
dispatch_event
Section titled “dispatch_event”Triggers a specific DOM event on an element.
Description
Section titled “Description”The dispatch_event command triggers a specific DOM event on an element. This is useful for triggering custom events that are not covered by other interaction commands.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
String | Yes | — | The selector for the element. |
event_type |
String | Yes | — | The type of event to dispatch (e.g., mouseover, change, focus). |
iframe |
String | No | "" |
The selector for the iframe containing the element. |
timeout |
Number (ms) | No | 5000 |
Maximum time to wait for the element. |
Example
Section titled “Example”{ "command": "dispatch_event", "params": { "selector": "css=.custom-component", "event_type": "change" }}Common Event Types
Section titled “Common Event Types”| Event Type | Description |
|---|---|
click |
Mouse click event |
mouseover |
Mouse over event |
mouseout |
Mouse out event |
change |
Change event (for form elements) |
focus |
Focus event |
blur |
Blur event |
input |
Input event (for form elements) |
submit |
Form submit event |
- Use
dispatch_eventfor custom events that are not covered by other interaction commands. - Use
dispatch_eventto trigger events that are not triggered by normal user interactions.