executeModelAction
Execute any model-specific action on a webpage element, such as typing text, selecting options, setting dates, or checking boxes. Supply an element ID or CSS selector to run the action.
Instructions
Universal tool to execute any model-specific action on element.
This tool works with element models (Strategy Pattern) and can execute any action defined by the model. Use analyzePage() first to see element's model and available actions in the 'models' map.
Models: TxtInp (text input), Sel (select), Btn (button), Chk (checkbox), Radio (radio), TxtArea (textarea), Link (link), Range (range), DatePicker (custom date picker), DateInp (HTML5 date), FileInp (file), ColorInp (color).
Examples:
executeModelAction({id: "input_20", action: "type", params: {text: "hello"}})
executeModelAction({id: "select_5", action: "selectOption", params: {value: "US"}})
executeModelAction({id: "datepicker_3", action: "SetDate", params: {date: "2024-03-15"}})
executeModelAction({id: "checkbox_7", action: "check"})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Element APOM ID (e.g., 'input_20') from analyzePage. Either id or selector required. | |
| action | Yes | Action name to execute (e.g., 'type', 'click', 'SetDate'). See element's model in analyzePage 'models' map for available actions. | |
| params | No | Action parameters (depends on action). Examples: {text: 'hello'} for type, {date: '2024-03-15'} for SetDate, {value: 'US'} for selectOption | |
| selector | No | CSS selector (alternative to id). Either id or selector required. |