Skip to content

Instantly share code, notes, and snippets.

@aaltat
Created March 12, 2018 20:03
Show Gist options
  • Save aaltat/a7f71e960d1bc3c6f90bfebb216162f0 to your computer and use it in GitHub Desktop.
Save aaltat/a7f71e960d1bc3c6f90bfebb216162f0 to your computer and use it in GitHub Desktop.
Firefox move_to_element bug
from __future__ import print_function
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Firefox()
driver.get('https://github.com/robotframework/SeleniumLibrary')
xpath = '//*[@id="user-content-history"]'
while not driver.find_elements_by_xpath(xpath):
print('Sleep 1')
time.sleep(1)
element = driver.find_element_by_xpath(xpath)
ActionChains(driver).move_to_element(element).perform()
time.sleep(5)
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment