'How mo to perform a mouseover in Firefox with Selenium Python?

Basically, we will need to use ActionChains move_to_element() method, but in fact it is not working in Firefox. The code is:

def hover_element(self, element):
    self._driver.execute_script('arguments[0].scrollIntoView({block: "center"});', element)
    from selenium.webdriver.common.action_chains import ActionChains
    action = ActionChains(self._driver)
    action.move_to_element(element).perform()

But it is not working (only scrolls into view, of course). How can I deal with it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source