Method: Watir::Browser#execute_script
- Defined in:
- lib/watir-webdriver/browser.rb
#execute_script(script, *args) ⇒ Object
Executes JavaScript snippet.
If you are going to use the value snippet returns, make sure to use ‘return` explicitly.
253 254 255 256 257 258 |
# File 'lib/watir-webdriver/browser.rb', line 253 def execute_script(script, *args) args.map! { |e| e.kind_of?(Watir::Element) ? e.wd : e } returned = @driver.execute_script(script, *args) wrap_elements_in(returned) end |