Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:02
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
public void selectFromDropDownWithHover(String menuTitle, String menuItem, String locatorType) throws Exception {
Actions actions = new Actions(manager.getDriver());
//first we find the menu title on which we will hover mouse cursor
WebElement menuHoverLink = findElementByLocator(locatorType, menuTitle);
//now we hover it with mouse
//let's find our menu item
WebElement menuItemElement = findElementByLocator(locatorType, menuItem);
public WebElement findElementByLocator(By locator) throws Exception {
return manager.getDriver().findElement(locator);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment