How to work with inner scroll bars?

60 views
Skip to first unread message

Anji Boddupally

unread,
Feb 14, 2014, 1:09:41 PM2/14/14
to seleniu...@googlegroups.com

Hi,

I have a requirement on may that, i need to work the scroll bar which in <div> tag on my page. See attached.
To access main scroll bar, i can execute java script code - window.scrollBy(), but how do i access the inner scroll bar which is DIV tag.

Note : Innter scroll bar is not in frame, also not in sepreate window on the page.

Plz help.

David

unread,
Feb 15, 2014, 3:04:54 PM2/15/14
to seleniu...@googlegroups.com
Try executing javascript against the DOM element's scrollTop & scrollLeft properties, changing their values to force a scroll to occur. These may or may not work, but seem like an option to try.


for example

(JavascriptExecutor) driver.executeScript("arguments[0].scrollTop = arguments[1];", theDivWebElement, numberOfTimesToScroll);

I would assume to scroll in the other direction, you might use a negative value but not sure. or you'd have to specify direction somehow.
Reply all
Reply to author
Forward
0 new messages