================================
OS: Win7
Selenium: 2.33.0
Firefox: 22.0
Python: 2.7.4
================================
I want to move the mouse cursor to the element "input" with method "move_to_element", but can't do it.
Do anyone have this issue?
================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from selenium.webdriver.common.by import By
import selenium.webdriver as webdriver
import time
firefox = webdriver.Firefox()
firefox.get("http://www.baidu.com")
input = firefox.find_element_by_id("kw")
action = webdriver.ActionChains(firefox)
action.send_keys_to_element(input, "testvalue")
action.perform()
#This step (move mouse to "input" element) NOT work! :(
action = webdriver.ActionChains(firefox)
action.move_to_element(input)
action.perform()
time.sleep(3)
firefox.quit()
Problem solved. I thought move_to_element() method should move the real mouse cursor to the object. But selenium does the mouse hover without moving real mouse cursor. Thanks.