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

type: "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.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector(s) or XPath for the target element.
indexoptionalnumberWhich visible match to target (0 = first). Default: 0. Alias: targetIndex.
forceoptionalbooleanSkip 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().
JSON
{ "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

type: "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.

ParamTypeDescription
selectorsrequiredstring[]Array of CSS selectors to choose from.
priorityoptionalstring | string[]Selectors to try first. If any are visible and clickable, they win; otherwise falls back to the full random pool.
weightsoptionalnumber[]Probability weights parallel to selectors (e.g. [60, 30, 10]). Omit for uniform random.
indexoptionalnumberTarget only the Nth visible match per selector instead of pooling all matches.
forceoptionalbooleanSkip pointer-event actionability check.
include_framesoptionalbooleanSearch inside iframes. Default: true.
max_matches_per_selectoroptionalnumberMax elements to consider per selector (1-50). Default: env CLICK_RANDOM_MAX_MATCHES or 20.
assume_success_on_timeoutoptionalbooleanTreat a click timeout as success. Default: false (strict — a timeout means the click failed and the next candidate is tried).
repick_on_retryoptionalbooleanPick a different element on step retry instead of repeating. Default: false (pinned).
JSON
{ "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

type: "dblclick"

Double-clicks an element using trusted CDP pointer input.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector for the target element.
indexoptionalnumberWhich visible match to target. Default: 0.
timeoutoptionalnumberTimeout in ms. Default: 6000.
JSON
{ "type": "dblclick", "selector": ".expand-row" }
{ "type": "dblclick", "selector": "#editable-cell", "index": 3 }

hover

type: "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.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector for the target element.
indexoptionalnumberWhich visible match to target. Default: 0.
timeoutoptionalnumberTimeout in ms. Default: 4000.
JSON
{ "type": "hover", "selector": ".dropdown-trigger" }
{ "type": "hover", "selector": ".tooltip-target", "timeout": 3000 }

right_click

type: "right_click"
type: "rightclick"

Right-clicks (context menu) on an element.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector for the target element.
indexoptionalnumberWhich visible match to target. Default: 0.
timeoutoptionalnumberTimeout in ms. Default: 8000.
JSON
{ "type": "right_click", "selector": ".context-menu-target" }

long_press

type: "long_press"
type: "longpress"

Long-presses an element (press and hold). Common on mobile for context menus or selection.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector for the target element.
durationoptionalnumberHold time in ms. Default: 600. Alias: hold.
indexoptionalnumberWhich visible match to target. Default: 0.
timeoutoptionalnumberTimeout in ms. Default: 8000.
JSON
{ "type": "long_press", "selector": ".menu-item", "duration": 800 }
{ "type": "long_press", "selector": "#selectable-text", "hold": 1000 }

drag_to

type: "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.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector for the element to drag (source).
targetSelectoroptionalstring | string[]CSS selector for the drop target. Alias: target_selector. Required if no offset is given.
xOffsetoptionalnumberHorizontal pixel offset to drag by. Alias: x_offset.
yOffsetoptionalnumberVertical pixel offset to drag by. Alias: y_offset.
indexoptionalnumberWhich visible source match to target. Default: 0.
timeoutoptionalnumberTimeout in ms. Default: 8000.
JSON
{ "type": "drag_to", "selector": "#slider-handle", "xOffset": 200 }
{ "type": "drag_to", "selector": "#item", "targetSelector": "#drop-zone" }

click_canvas

type: "click_canvas"
type: "clickcanvas"

Clicks at specific coordinates within a canvas or other element. The coordinates are relative to the element's top-left corner.

ParamTypeDescription
selectorrequiredstring | string[]CSS selector for the canvas/target element.
xrequirednumberHorizontal pixel offset within the element.
yrequirednumberVertical pixel offset within the element.
indexoptionalnumberWhich visible match to target. Default: 0.
JSON
{ "type": "click_canvas", "selector": "canvas#map", "x": 150, "y": 200 }