Method: Selenium::Client::GeneratedDriver#add_script

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

#add_script(scriptContent, scriptTagId) ⇒ Object

Loads script content into a new script tag in the Selenium document. This differs from the runScript command in that runScript adds the script tag to the document of the AUT, not the Selenium document. The following entities in the script content are replaced by the characters they represent:

<
>
&

The corresponding remove command is removeScript.

‘scriptContent’ is the Javascript content of the script to add ‘scriptTagId’ is (optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail.

[View source]

1596
1597
1598
# File 'lib/selenium/client/legacy_driver.rb', line 1596

def add_script(scriptContent,scriptTagId)
    remote_control_command("addScript", [scriptContent,scriptTagId,])
end