How to check Scroll bar present in the page

2,934 views
Skip to first unread message

SOURABH TIWARI

unread,
Apr 23, 2012, 6:15:42 AM4/23/12
to robotframework-users
Hi,

How can i check that scroll bar is available on the page or not using SeleniumLibrary , I am not talking about scroll bar for any text box or other control neither browser scroll bar, i want to check whether the page is having the scroll bar or not.

Thanks

Sourabh

David

unread,
Apr 23, 2012, 8:58:20 PM4/23/12
to robotframework-users
I don't think Selenium by default has built in commands to check
scrollbars. So the alternative is to use javascript to validate
whether scrollbars exist or not.

And the technique is likely similar, though syntax slightly different
for checking scrollbars of a page vs an element.

For checking page, you can do some online searches for solution. You
might find it here:

http://stackoverflow.com/questions/2146874/detect-if-a-page-has-a-vertical-scrollbar

adapting to Selenium could be similar to this:

See section "Verify vertical scrollbar appears for the text-area
element" in URL below.
http://selenium-automation.blogspot.com/2010/10/selenium-automation-problems.html

horizontal would be similar, just replace "Height" with "Width" in the
object properties to compare

Pate Nirav

unread,
Oct 26, 2014, 12:48:39 AM10/26/14
to robotframe...@googlegroups.com, sour...@gmail.com
Reply all
Reply to author
Forward
0 new messages