That would scroll it all right.
So your page only makes that element visible when it is in the viewable section of the page? Is it that animated ad that pops up at the bottom?
I am not certain, but I think if you were to set the focus on some element near the bottom Selenium would scroll down there and make it visible for you.
Mike
On Thursday, September 13, 2012 3:33:59 AM UTC-7, Erik Winter wrote:
I needed to scroll like that for a particular case where the element was hidden until the user scrolls down, see the bottom bar at
http://www.c1000.nl/ for example.
I used the follwing code to solve this (java):
JavascriptExecutor js = (JavascriptExecutor) this.driver;
js.executeScript("window.scrollTo(0, document.body.scrollHeight); return true");
Hope this helps,
Erik Winter
Op dinsdag 11 september 2012 19:07:05 UTC+2 schreef Mike Riley het volgende: