Skip to content

Instantly share code, notes, and snippets.

@foxwill
Created October 17, 2016 18:25
Show Gist options
  • Save foxwill/bcb187a3fa8718360db79b25564349e0 to your computer and use it in GitHub Desktop.
Save foxwill/bcb187a3fa8718360db79b25564349e0 to your computer and use it in GitHub Desktop.
Capybara Cucumber Ruby ScrollToElement
#where @session is Capybara::session instance
#and object is a Capybara::Node::Element istance
@session.driver.execute_script "window.scrollTo(#{object.native.location.x},#{object.native.location.y})"
return_string = object.native.click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment