SELENIUM BASICS:


SELENIUM WEBDRIVER:


TESTNG:


REPORTS:


BUILD & CONTINUOUS INTEGRATION TOOLS:


CROSS BROWSER TESTING:


MOBILE TESTING:


AUTOMATION FRAMEWORKS:


API Testing:


INTERVIEW QUESTIONS:


SAMPLE RESUME:

Mouse Hover Actions Using Actions Class In Selenium

Mouse Hover Actions Using Actions Class:

Sometimes, sub menu items render in DOM only when we mouse hover on main menu. In that case, we face difficulty to click on sub menu item. In order to perform mouse hover actions, we need to chain all of the actions that we want to achieve in one go. To do this we need to make the driver move to the parent element that has child elements and click on the child element.

To achieve this we use Actions class in Selenium WebDriver.

Must Read: Actions Class in Selenium WebDriver

Create object of an Actions Class by passing the WebDriver instance. With the object of the Actions class, driver moves to the main menu and then to the sub menu and click on it.

Let’s see some scenarios.

Mouse hover actions on an element using Actions Class:

Mouse hover actions on a sub-element using Actions Class:

If we want to click on the sub-element, first we need to mouse hover on the parent-element and then sub-element and click on it.

Or

If you are not regular reader of my blog then I highly recommend you to signup for the free email newsletter using the below link.

Sharing is caring.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

4 thoughts on “Mouse Hover Actions Using Actions Class In Selenium”

  1. Hi Menus like,

    In your website “https://www.softwaretestingmaterial.com/mouse-hover-actions-using-selenium/”

    Go to tutorials –> Selenium —> Jenkins

    i want to click on jenkins.

    then how should i write the code?

Leave a Comment

Your email address will not be published. Required fields are marked *

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook

DOWNLOAD FOR FREE