Mouseover in Selenium Webdriver

How to handle Mouseover in Selenium Webdriver:

There are many application you will find that when you mouseover then dropdown expand or it's perform an action. You don't need any click or right click of that element.
In that situation how you will handle in Selenium Webdriver? If you find that element ID or xpath or any other locator and click on that element but it will not work for Selenium Webdriver.
You have to use Action Class to perform this type of action otherwise it will not work. Please see the following image for code.

How to handle Hidden Element in Selenium webdriver:


If you find any element type is 'Hidden' and you try to click that element by regular click then it will not work in Selenium Webdriver. To handle hidden element you should use Javascriptexecutor. With the help of javascriptexecutor you will be able to overcome this situation. Please see the following image for code.
Mouseover and Hidden element in Selenium webdriver

1 comment:

  1. Those who want to learn Selenium can study this. Thanks for sharing this valuable topic.

    ReplyDelete