javascript - Get scrollTop, scrollLeft etc. from element with selenium -


in python/django test element, scrolled via scrolltop, want value of scrolltop.

in javascript value via

element.scrolltop 

in python tried following:

element.get_attribute('scrolltop') 

this gave me none. how can scrolltop in selenium?

the scrolltop of element not attribute, javascript property. you'll need use execute_script method retro property value. code this:

# warning! code translated other languages memory. # exact python syntax may incorrect, , need adjustment. driver.execute_script("return arguments[0].scrolltop;", element) 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -