Click Actions
Actions for clicking, hovering, dragging, and other pointer interactions. All clicks use trusted browser input (CDP pointer) — never synthetic JS events. Elements are automatically scrolled into view before interaction.
click
Clicks an element using trusted CDP pointer input. The engine finds the element (scanning page + all frames), scrolls it into view, and clicks with natural coordinates. Automatically detects critical submit buttons and gates duplicate submissions.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector(s) or XPath for the target element. |
| indexoptional | number | Which visible match to target (0 = first). Default: 0. Alias: targetIndex. |
| forceoptional | boolean | Skip the pointer-event actionability check. Use for elements covered by CSS overlays (e.g. radio labels wrapping hidden inputs). Still uses real CDP click, NOT JS .click(). |
{ "type": "click", "selector": "#submit-btn" }
{ "type": "click", "selector": ["#next", ".continue-btn"] }
{ "type": "click", "selector": ".option-label", "force": true }
{ "type": "click", "selector": ".item", "index": 2 }click_random
Clicks ONE random element from a list of selectors. Each selector is scanned across the page and all frames; all visible/enabled matches are pooled and one is picked at random. The chosen element is pinned on retry — a step retry repeats the same click. Supports priority selectors and weighted probability.
| Param | Type | Description |
|---|---|---|
| selectorsrequired | string[] | Array of CSS selectors to choose from. |
| priorityoptional | string | string[] | Selectors to try first. If any are visible and clickable, they win; otherwise falls back to the full random pool. |
| weightsoptional | number[] | Probability weights parallel to selectors (e.g. [60, 30, 10]). Omit for uniform random. |
| indexoptional | number | Target only the Nth visible match per selector instead of pooling all matches. |
| forceoptional | boolean | Skip pointer-event actionability check. |
| include_framesoptional | boolean | Search inside iframes. Default: true. |
| max_matches_per_selectoroptional | number | Max elements to consider per selector (1-50). Default: env CLICK_RANDOM_MAX_MATCHES or 20. |
| assume_success_on_timeoutoptional | boolean | Treat a click timeout as success. Default: false (strict — a timeout means the click failed and the next candidate is tried). |
| repick_on_retryoptional | boolean | Pick a different element on step retry instead of repeating. Default: false (pinned). |
{ "type": "click_random", "selectors": ["#option-a", "#option-b", "#option-c"] }
82
{ "type": "click_random", "selectors": ["#option-a", "#option-b", "#option-c"], "priority": ["#option-b"] }
242
{
"type": "click_random",
"selectors": [".choice-1", ".choice-2", ".choice-3"],
"weights": [60, 30, 10]
}dblclick
Double-clicks an element using trusted CDP pointer input.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector for the target element. |
| indexoptional | number | Which visible match to target. Default: 0. |
| timeoutoptional | number | Timeout in ms. Default: 6000. |
{ "type": "dblclick", "selector": ".expand-row" }
{ "type": "dblclick", "selector": "#editable-cell", "index": 3 }hover
Hovers the pointer over an element (mouseover). Automatically skipped on touch profiles — mobile devices have no hover state, and dispatching a synthetic hover would be detectable.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector for the target element. |
| indexoptional | number | Which visible match to target. Default: 0. |
| timeoutoptional | number | Timeout in ms. Default: 4000. |
{ "type": "hover", "selector": ".dropdown-trigger" }
{ "type": "hover", "selector": ".tooltip-target", "timeout": 3000 }right_click
Right-clicks (context menu) on an element.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector for the target element. |
| indexoptional | number | Which visible match to target. Default: 0. |
| timeoutoptional | number | Timeout in ms. Default: 8000. |
{ "type": "right_click", "selector": ".context-menu-target" }long_press
Long-presses an element (press and hold). Common on mobile for context menus or selection.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector for the target element. |
| durationoptional | number | Hold time in ms. Default: 600. Alias: hold. |
| indexoptional | number | Which visible match to target. Default: 0. |
| timeoutoptional | number | Timeout in ms. Default: 8000. |
{ "type": "long_press", "selector": ".menu-item", "duration": 800 }
{ "type": "long_press", "selector": "#selectable-text", "hold": 1000 }drag_to
Drags an element to another element or by a pixel offset. Uses trusted CDP pointer. Verifies that the source element moved after the drag.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector for the element to drag (source). |
| targetSelectoroptional | string | string[] | CSS selector for the drop target. Alias: target_selector. Required if no offset is given. |
| xOffsetoptional | number | Horizontal pixel offset to drag by. Alias: x_offset. |
| yOffsetoptional | number | Vertical pixel offset to drag by. Alias: y_offset. |
| indexoptional | number | Which visible source match to target. Default: 0. |
| timeoutoptional | number | Timeout in ms. Default: 8000. |
{ "type": "drag_to", "selector": "#slider-handle", "xOffset": 200 }
{ "type": "drag_to", "selector": "#item", "targetSelector": "#drop-zone" }click_canvas
Clicks at specific coordinates within a canvas or other element. The coordinates are relative to the element's top-left corner.
| Param | Type | Description |
|---|---|---|
| selectorrequired | string | string[] | CSS selector for the canvas/target element. |
| xrequired | number | Horizontal pixel offset within the element. |
| yrequired | number | Vertical pixel offset within the element. |
| indexoptional | number | Which visible match to target. Default: 0. |
{ "type": "click_canvas", "selector": "canvas#map", "x": 150, "y": 200 }