How can I perform mouse hover action in Selenium-Python?

0 votes
How can I perform mouse hover action in Selenium-Python?
Jul 23 in Selenium by Payal
148 views

1 answer to this question.

0 votes

Hey Payal, use the code snippet shown below to perform mouse hover in Python with Selenium:

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
    
driver = webdriver.Firefox()
driver.get("https://www.edureka.co")

action = ActionChains(driver);

parent_level_menu = driver.find_element_by_id("tabscathome")
action.move_to_element(parent_level_menu).perform()

child_level_menu = driver.find_element_by_xpath("//a[contains(text(),'DevOps')]")
child_level_menu.click();

sleep(10)

driver.close()
answered Jul 23 by Abha
• 27,180 points

Related Questions In Selenium

+2 votes
2 answers

How can I press ENTER key with the execute_script in selenium python?

The below code containing Keys.ENTER might just ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,110 points
8,556 views
+1 vote
2 answers
0 votes
1 answer

How can I write test scripts in Selenium with python?

Hey Khushi, writing test scripts in Selenium ...READ MORE

answered May 9 in Selenium by Anvi
• 13,960 points
82 views
0 votes
1 answer
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8 in Selenium by Anvi
• 13,960 points
273 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
1,147 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,150 points
1,246 views
0 votes
1 answer
0 votes
1 answer

How can I manually set proxy settings in Python Selenium?

Hi Jyotsana, you can manually set proxy ...READ MORE

answered Jul 29 in Selenium by Abha
• 27,180 points
1,060 views