Method: Capybara::Session#evaluate_script
- Defined in:
- lib/capybara/session.rb
#evaluate_script(script, *args) ⇒ Object
Evaluate the given JavaScript and return the result. Be careful when using this with scripts that return complex objects, such as jQuery statements. #execute_script might be a better alternative.
619 620 621 622 623 |
# File 'lib/capybara/session.rb', line 619 def evaluate_script(script, *args) @touched = true result = driver.evaluate_script(script.strip, *driver_args(args)) element_script_result(result) end |