Method: Capybara::Node::Element#evaluate_async_script
- Defined in:
- lib/capybara/node/element.rb
#evaluate_async_script(script, *args) ⇒ Object
Evaluate the given JavaScript in the context of the element and obtain the result from a
callback function which will be passed as the last argument to the script. this in the
script will refer to the element this is called on.
529 530 531 532 533 534 535 |
# File 'lib/capybara/node/element.rb', line 529 def evaluate_async_script(script, *args) session.evaluate_async_script(<<~JS, self, *args) (function (){ #{script} }).apply(arguments[0], Array.prototype.slice.call(arguments,1)); JS end |