focus_element
Scroll to, focus, or highlight a page element without clicking or typing. Use it to bring elements into view, set keyboard focus, or highlight for debugging.
Instructions
Scroll to, focus, or highlight an element.
This tool does not click, type, select, hover, or otherwise activate the
element. Use click_element, type_text, or hover_action for those
operations.
Args: selector: CSS selector or SeleniumBase selector identifying the target.
action:
- "scroll_to_element": Scroll the element into the viewport.
- "focus": Move keyboard focus to the element.
- "highlight": Temporarily highlight the element for debugging or
demonstration by changing the border color. May affect timing
and/or reduce stealth.
timeout: Maximum seconds to wait for the target element. Default: 5.If there's no matching element found within the timeout, then @handle_sb_errors returns details from the exception raised.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | scroll_to_element | |
| timeout | No | ||
| selector | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |