Skip to main content
The agentic_mouse_action method performs mouse actions at specific screen coordinates captured during a recording. If the action fails at those coordinates (e.g., due to page layout changes), it falls back to the Operator agent using a natural language query.
This method is primarily used by agents generated through Imitation Learning, where click coordinates are captured during recording. For most manual automations, prefer agentic_selector() which targets elements by CSS selectors.

Method Signature

Parameters

action
AgenticMouseAction
required
The mouse action to perform. Supported actions:
recorded_click
RecordedClick
required
The coordinates and viewport dimensions from when the action was originally recorded.
fallback_operator_query
str
required
Natural language instruction for the Operator agent to use if the coordinate-based action fails.
resize_window
bool
default:"True"
Whether to resize the browser window to match the recorded viewport dimensions before performing the action. This improves accuracy when the page layout is responsive.
timeout
int | None
default:"60"
Maximum time in seconds to wait for the operation to complete.

Return Value

This method returns None and completes when the action has been performed successfully.

Example

When to Use This vs agentic_selector

Both methods fall back to the Operator agent when their primary targeting strategy fails, ensuring robust automation even when pages change.