WebDriver/Marionette/Marionette Client API: Difference between revisions

Jump to navigation Jump to search
Line 26: Line 26:
* {{done|'''execute_script(script)'''}}: executes a synchronous JavaScript script, and returns the value which the script returns
* {{done|'''execute_script(script)'''}}: executes a synchronous JavaScript script, and returns the value which the script returns
* {{done|'''execute_async_script(script)'''}}: executes an asynchronous JavaScript script; returns only when script calls <code>marionetteScriptFinished(return_value);</code>.  script will generate a TimeoutException if the script does not call <code>marionetteScriptFinished</code> within the timeout specified by 'set_script_timeout'.
* {{done|'''execute_async_script(script)'''}}: executes an asynchronous JavaScript script; returns only when script calls <code>marionetteScriptFinished(return_value);</code>.  script will generate a TimeoutException if the script does not call <code>marionetteScriptFinished</code> within the timeout specified by 'set_script_timeout'.
For both methods, scripts can not set global variables which persist between script executions.  Instead, scripts wishing to share data between calls should add properties to the window object.  For scripts executed in the content context, security restrictions require that custom properties of the window object be accessed using window.wrappedJSObject.
Confirmed users
1,905

edits

Navigation menu