Sha256: 700d28f05ccb3db434da5974391a2c58a534cedf17a93878ff909fb3a3cd535b
Contents?: true
Size: 776 Bytes
Versions: 5
Compression:
Stored size: 776 Bytes
Contents
# Executing JavaScript Executing JavaScript requires automating a browser. === "Ferrum" ```ruby class DummyJob < Wayfarer::Base route { to :index } def index browser.evaluate("[window.scrollX, window.scrollY]") end end ``` === "Selenium" ```ruby class DummyJob < Wayfarer::Base route { to :index } def index # Mind the explicit return browser.execute_script("return [window.scrollX, window.scrollY]") end end ``` === "Capybara" ```ruby class DummyJob < Wayfarer::Base route { to :index } def index # Capybara does not return value of JavaScript execution browser.execute_script("console.log('Foobar')") # => nil end end ```
Version data entries
5 entries across 5 versions & 1 rubygems