ui_invoke
Invoke UI elements (buttons, menu items, hyperlinks) via UIA InvokePattern without mouse movement, even when off-screen or obscured. Falls back to Click() when unsupported.
Instructions
Invoke a UI element using UIA InvokePattern (no mouse movement).
Note: If app is STOPPED at breakpoint, resume with continue_execution() first.
Preferred over ui_click for buttons, menu items, and hyperlinks because it works reliably even when the element is off-screen or partially obscured. Falls back to Click() if InvokePattern is not supported.
WPF top-level MenuItem headers: scope the native ENTER key to the parent, then rediscover the popup child and call ui_invoke separately for that exact child. Do not add a fixture-specific key handler. Invoking the parent alone does not guarantee submenu peers materialize. Use pre/post UI oracles; a child missing after verified expansion is a harness observation, not automatically a product defect.
Args: automation_id: AutomationId property name: Element's Name/Title property control_type: Control type (Button, MenuItem, Hyperlink, etc.) root_id: Optional AutomationId to scope search to a subtree xpath: Optional XPath expression (FlaUI backend only)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| xpath | No | ||
| root_id | No | ||
| control_type | No | ||
| automation_id | No |