execute_script
Runs JavaScript in the current browser page or an Appium mobile command with arguments, returning values or elements for custom automation tasks; use dedicated tools for standard clicks and typing.
Instructions
Runs JavaScript in the page (return a value; string args that match a selector are passed as elements) or, on Appium, a "mobile: " with args. Prefer the dedicated tools for clicks and typing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Script arguments, or the mobile command's parameters | |
| script | Yes | JavaScript, or "mobile: <command>" on Appium | |
| session | No | Target session: map name or sessionId. Omit to use the default session. |