Skip to content Skip to sidebar Skip to footer

Selenium/python - Hover And Click On Element

I'm running into an issue with my Selenium script on Python. In the javascript web application that I'm interacting with, an element I need to click doesn't exist until I hover ove

Solution 1:

Following had worked for me, please give a try:

add = driver.find_element_by_css_selector('input.add')
SearchButton = driver.find_element_by_css_selector('input.add1')

Hover = ActionChains(driver).move_to_element(add).move_to_element(SearchButton)
Hover.click().build().perform()

I'm not sure about above Python code. But you can use above logic.

Solution 2:

here another useful link How to mouseover in python Webdriver

@TDHM you should mention this below line to make it works

from selenium.webdriver.common.action_chainsimportActionChains

thank you

Post a Comment for "Selenium/python - Hover And Click On Element"