Capture: element action
Do one action on a captured element: click, type, read text, attributes or all properties, select, check, hover, drag, upload, wait and more. The element is the captured object (properties you choose, each with its own match rule) or a selector.
Command in the Browser toolkit · id ooa.browser/element_action · 26 inputs (1 required), 2 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Captured object | Dictionary | No | The captured object from Capture in OneAgentStudio: the properties to match (each with use and a match rule: equals, not_equals, contains, starts_with, ends_with, wildcard, regex), search_by (properties, css or xpath), index when several elements match, and iframes. Used instead of the selector when given. | |
| Selector | String | No | Element selector: CSS (#id, .class), text="Sign in", role=button[name="Save"] or xpath=//input[@name='q']. Used when no captured object is given. | |
| Action | String | Yes | What to do with the element. OneAgentStudio lists the actions that suit the captured control type. | |
| Value | Any | No | Depends on the action: the text to type, the key (e.g. Enter, Ctrl+A), the attribute or property name, the option text, value or index, the target selector for drag_to, the file path(s) for upload_file, or the image path for screenshot. Credentials allowed for set_text. | |
| Wait up to (milliseconds) | Number | No | 30000 | How long to wait for the element, in milliseconds. |
| Click method | String | No | mouse | mouse: a real click at the element (scrolls it into view and waits until it can be clicked); javascript: fire the click event directly, for elements that are covered or off screen; debugger: a click sent through the browser's debugging channel with no script put into the page, for sites whose security rules block scripts (G4). |
| Modifiers | String | No | Keys held during the click, e.g. CTRL, SHIFT or CTRL+SHIFT. | |
| Offset x | Number | No | Click this many pixels from the element's left edge instead of its centre. | |
| Offset y | Number | No | Click this many pixels from the element's top edge instead of its centre. | |
| Typing | String | No | fill | fill: set the whole text at once (fast); keystrokes: type key by key like a person, for fields that react to each key. |
| Key delay (milliseconds) | Number | No | 0 | Pause between keys when typing is keystrokes. |
| Clear first | Boolean | No | true | Clear the field before set_text. |
| Force | Boolean | No | false | Act even if the element looks hidden, covered or disabled. |
| Wait after (milliseconds) | Number | No | 0 | Pause after the action, e.g. to let the page react. |
| Use captured page | Boolean | No | false | Switch to the open tab whose address (and title, when its match rule is set) matches the page recorded with the captured object. |
| Session | String | No | browser | Session name. |
| Alternatives | Dictionary | No | Self-healing fallbacks recorded with the element (Pick records them): automation_id, name, id, aria_label, tag, class, index, text, relative {anchor, direction}. Tried in that order when the selector finds nothing; the one that works is logged. | |
| Window | Dictionary | No | Which window to act in. Leave empty to use the session's current tab. {"source": "browser", "title": "Invoice * - Shop", "title_match": "wildcard", "url": "...", "url_match": "contains", "browser": "edge"} switches to the first open tab whose title and/or address matches (also in attached browsers, and in one listening on port 9222); {"source": "variable", "variable": "session name"} uses that browser session; {"source": "application", "title": "..."} names a desktop window, which works only when it is a window of an attached browser. Matches: wildcard (default for the title), contains (default for the address), equals or regex; text matches ignore case. Values may use variables. | |
| Wait for page (milliseconds) | Number | No | 0 | First wait up to this long for the page to finish loading (0: don't wait). Counts as not found when it runs out. |
| If not found | String | No | error | When the page or the element is not there in time: error stops with an error; continue skips this step (result is empty) and carries on. |
| Row | Number | No | Table cell actions: the row, 1 for the first. | |
| Column | Number | No | Table cell actions: the column, 1 for the first. | |
| Run in background | Boolean | No | false | Leave the browser window where it is: the tab is not brought to the front and clicks are sent to the page (not with the mouse), so other work on the screen can go on. |
| Find text | String | No | click_cell_by_text and set_cell_by_text: the text of the cell to find (an exact match first, else the first cell containing it) (G4). | |
| Click kind | String | No | click | How a table cell is clicked (G4). |
| Index from one | Boolean | No | false | select_by_index counts from 1 for the first item, as Get selected index does; off counts from 0 as older steps did (G4). |
Outputs
| Output | Type | What it is |
|---|---|---|
| result | Any | Value returned by get, is, count, wait and coordinate actions. |
| found | Boolean | False when the step was skipped because the element was not found (if_not_found = continue). |