Method: Selenium::WebDriver::Driver#execute_async_script

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

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

Execute an asynchronous piece of JavaScript in the context of the currently selected frame or window. Unlike executing execute_script (synchronous JavaScript), scripts executed with this method must explicitly signal they are finished by invoking the provided callback. This callback is always injected into the executed function as the last argument.

Parameters:

  • script (String)

    JavaScript source to execute

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

    Arguments to the script. May be empty.

Returns:



254
255
256
# File 'lib/selenium/webdriver/common/driver.rb', line 254

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