# 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 ```