Document
session.getPageSource()
Returns a string serialization of the DOM of the current browsing context active document.
RETURNS
Promise<string>
EXAMPLES
SEE ALSO
session.executeScript<T>(script, args)
Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be synchronous and the result of evaluating the script is returned to the client.
PARAMETERS
script
: string - JavaScript to execute in browser contextargs
: unknown[] - Arguments to sent to executed script
RETURNS
Promise<T>
EXAMPLES
SEE ALSO
session.executeAsyncScript<T>(script, args)
causes JavaScript to execute as an anonymous function. Unlike the Execute Script command, the result of the function is ignored. Instead an additional argument is provided as the final argument to the function. This is a function that, when called, returns its first argument as the response.
PARAMETERS
script
: string - JavaScript to execute in browser contextargs
: unknown[] - Arguments to sent to executed script
RETURNS
Promise<T>
EXAMPLES
SEE ALSO
Last updated