Method: Selenium::Client::GeneratedDriver#run_script

Defined in:
lib/selenium/client/legacy_driver.rb

#run_script(script) ⇒ Object

Creates a new “script” tag in the body of the current test window, and adds the specified text into the body of the command. Scripts run in this way can often be debugged more easily than scripts executed using Selenium’s “getEval” command. Beware that JS exceptions thrown in these script tags aren’t managed by Selenium, so you should probably wrap your script in try/catch blocks if there is any chance that the script will throw an exception.

‘script’ is the JavaScript snippet to run

[View source]

1526
1527
1528
# File 'lib/selenium/client/legacy_driver.rb', line 1526

def run_script(script)
    remote_control_command("runScript", [script,])
end