session_execute
Run JavaScript in the page of a browser session and return its value. The script runs as a FUNCTION BODY, so it must return what you want back — a script with no return yields null, which is the usual reason this looks like it did nothing. args are passed through as the script's arguments. Browser sessions only. Addressed by sessionId. Use it for what the protocol has no verb for: reading a computed style, clearing an input before session_send_keys, scrolling an element into view. The equivalents elsewhere are web_evaluate (desktop grid page, by pageId) and ios_safari_evaluate / android_devtools_evaluate (real device browser, by udid).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Arguments to pass to the script | |
| script | Yes | JavaScript code to execute (e.g. "return document.title") | |
| sessionId | Yes | Session ID |