Related to selenuim python bindings - mouse over action

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Related to selenuim python bindings - mouse over action

Pavitra Hebbar
Hi all,

Mouse over is not recognized in selenium ide. Any alternative solution for it?

This is the code used, to perform hover action,still not working

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains

element_to_hover_over = driver.find_element_by_link_text("Documents")
hover = ActionChains(driver).move_to_element(element_to_hover_over)
hover.perform()

Got this error message after running the above code
ERROR: test_mouseover_browse (main.TestMouseoverBrowse) hover.perform()
Can any one please help me?

Thanks in advance,

 Pavitra
mks
Reply | Threaded
Open this post in threaded view
|

Re: Related to selenuim python bindings - mouse over action

mks
Replying with my working code. Might be helpful to you:

from selenium.webdriver.common.action_chains import ActionChains

element = driver.find_element_by_css_selector("xyz") # Can try with css selector

'''element = wd.find_element_by_link_text("xyz") '''

hov = ActionChains(driver).move_to_element(element) hov.perform()