I am currently working on a selenium test to test some pagination buttons
These buttons are outside the viewport of the screen...
In firefox I can execute this code just fine (obviously with driver = webdriver.Firefox)
from selenium.webdriver.common.action_chains import ActionChains
import selenium.common.exceptions
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
url = 'https://stackoverflow.com'
driver.get(url)
driver.maximize_window()
footer_link = driver.find_element_by_css_selector("#footer > div > nav > div:nth-child(1) > h5 > a")
action = ActionChains(driver)
action.move_to_element(footer_link).click().perform()
driver.quit()
(btw this is a minimal production of my error)
Again, the code works just fine in firefox
However in Chrome (version 89), the code fails with this error
selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds
I have tried a couple things to make it work, and I have been able to make it work by scrolling to the element with execute_script() but I need to use a sleep(), implicit wait, or explicit wait.
I would like to use the established way to scroll to the element without using sleep, aka using the ActionChains object
From the little bit of digging on the internet, I would assume this code to work, but I keep getting the same error...
Any help would be greatly appreciated!