Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cucumber Capybara scroll to bottom of page

I'd like to use my Cucumber/Capybara setup to test endless scroll by driving a browser and scrolling to the bottom of the page to ensure that the new content is loaded. Is there a way to do this?

like image 247
Eric M. Avatar asked Dec 12 '10 23:12

Eric M.


1 Answers

You could use javascript to achieve this:

page.execute_script "window.scrollBy(0,10000)" 
like image 154
Nat Ritmeyer Avatar answered Sep 24 '22 17:09

Nat Ritmeyer