I have a problem using function to scroll down using PageDown key via Selenium's ActionChains in python 3.5 on Ubuntu 16.04 x64.
What I want is that my program scrolls down by PageDown twice, so it reaches bottom at the end and so I can have selected element always visible.Tried making another function using Keys.END, but it did not work, so I assume it has something to do with ActionChains not closing or something.
The function looks like this:
from selenium.webdriver.common.action_chains import ActionChains
...
def scrollDown(self): body = browser.find_element_by_xpath('/html/body') body.click() ActionChains(browser).send_keys(Keys.PAGE_DOWN).perform()
and I use it in another file like this:
mod.scrollDown()
The first time I use it, it does scroll down as would if PageDown key would be pressed, while another time nothing happens.It does not matter where i call it, the second (or third...) time it does not execute.Tried doing it manually and pressed PageDown button twice, works as expected.Console does not return any error not does the IDE.