File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010For a steady stream of TILs from a variety of rocketeers, checkout
1111[ til.hashrocket.com] ( https://til.hashrocket.com/ ) .
1212
13- _ 580 TILs and counting..._
13+ _ 581 TILs and counting..._
1414
1515---
1616
@@ -461,6 +461,7 @@ _580 TILs and counting..._
461461- [ Returning With Sequel] ( ruby/returning-with-sequel.md )
462462- [ Running A Single MiniTest Example] ( ruby/running-a-single-minitest-example.md )
463463- [ Safe Navigation Operator] ( ruby/safe-navigation-operator.md )
464+ - [ Scroll To Top Of Page With Capybara] ( ruby/scroll-to-top-of-page-with-capybara.md )
464465- [ Set RVM Default Ruby] ( ruby/set-rvm-default-ruby.md )
465466- [ Show Public Methods With Pry] ( ruby/show-public-methods-with-pry.md )
466467- [ Squeeze Out The Extra Space] ( ruby/squeeze-out-the-extra-space.md )
Original file line number Diff line number Diff line change 1+ # Scroll To Top Of Page With Capybara
2+
3+ During a browser-based Capybara test, you may get partially scrolled down in
4+ the page which can obscure or overlay DOM elements. A sure-fire way to
5+ scroll back to the top is by executing the following line of JavaScript:
6+
7+ ``` ruby
8+ page.execute_script " window.scrollTo(0,0)"
9+ ```
10+
11+ This will scroll to ` 0,0 ` which is the top-most, left-most corner of the
12+ browser.
You can’t perform that action at this time.
0 commit comments