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