Method: Selenium::WebDriver::Driver#execute_script

Defined in:
lib/selenium/webdriver/common/driver.rb

#execute_script(script, *args) ⇒ WebDriver::Element, ... Also known as: script

Execute the given JavaScript

Parameters:

  • script (String)

    JavaScript source to execute

  • args (WebDriver::Element, Integer, Float, Boolean, NilClass, String, Array)

    Arguments will be available in the given script in the 'arguments' pseudo-array.

Returns:

  • (WebDriver::Element, Integer, Float, Boolean, NilClass, String, Array)

    The value returned from the script.



210
211
212
# File 'lib/selenium/webdriver/common/driver.rb', line 210

def execute_script(script, *args)
  bridge.execute_script(script, *args)
end