1from selenium import webdriver
2from selenium.webdriver.common.action_chains import ActionChains
3
4driver = webdriver.Firefox()
5driver.get('http://example.com')
6element_to_hover_over = firefox.find_element_by_id("foo")
7
8# actual hover
9ActionChains(driver).move_to_element(element_to_hover_over).perform()
1By using Actions class
2
3WebElement element = driver.findElement(By.xpath("xpath"));
4Actions action = new Actions(driver);
5action.moveToElement(element).perform();
6