Method: Selenium::WebDriver::Driver#execute_script

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

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

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.



235
236
237
# File 'lib/selenium/webdriver/common/driver.rb', line 235

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