How to test infinite scrolling on web page

978 views
Skip to first unread message

Anisha Narang

unread,
Dec 20, 2013, 4:53:20 AM12/20/13
to watir-...@googlegroups.com
Hi,

I am using watir-webdriver. The application that I am testing has infinite scrolling implemented. It is more or less like 1000 results present but dis[played 10 at a time and next 10 results appear on scrolling the page, so how do I test if infinite scrolling works or not on my web application.
I tried the following code:
@browser.execute_script("window.scrollTo(0,1500)")
sleep 5

But I do not see any movement on the browser. And also, how do I assert that infinite scrolling is working properly.

--
Regards,
Anisha Narang

Super Kevy

unread,
Dec 20, 2013, 9:54:46 AM12/20/13
to watir-...@googlegroups.com

Alex Rodionov

unread,
Dec 21, 2013, 2:58:39 AM12/21/13
to watir-...@googlegroups.com
Try to use watir-scroll - it might help you.

Chuck van der Linden

unread,
Jan 8, 2014, 5:48:48 PM1/8/14
to watir-...@googlegroups.com
This kind of thing is generally event driven, so find out what event is being issued by the browser when the page is scrolled down within x of the bottom,

count number or results by counting number of an unique element that exists in each result (usually in a header for the result)
fire the event that triggers the next segment load
wait for whatever loading indicator they display to go away
count number of results and see if it went up by the expected amount.

that the event fires is almost like testing the browser


Reply all
Reply to author
Forward
0 new messages