There is an invisible element on my HTML page which becomes visible when a mouse hover is done on the element. What I Have to do is
- Hover over the element
- Click on the element (it will display 4 options)
- Click on one of the options
I am using Java API for selenium web driver and following is what I have been trying
Actions builder = new Actions(driver);
builder.moveToElement(MainMenuBTN).click().build().perform();
subMenuBTN.click();
- MainMenuBTN = element that becomes visible when you hover the mouse over it
- subMenuBTN = element that is being chosen out of the menu options that are displayed
What is happening is, the click() on MainMenuBTN is generating ElementNotVisible exception. I tried following to avoid this, but did not work.
Actions builder = new Actions(driver);
builder.moveToElement(mainMenuBTN).build().perform();
builder.click();
subMenuBTN.click();
A Note : mainMenuBTN and subMenuBTN are WebElements generated by
driver.findElement(By.xpath("xpath_string"))
Am I missing anything? Help appreciated !
WebElement menu = driver.findElement(by); Actions builder = new Actions(driver); builder.moveToElement(menu).build().perform(); WebDriverWait wait = new WebDriverWait(driver, 15);After the sub menus are displayed i find the element using id and click on it. Unfortunately this works fine with FF 25 and Selenium 2.42.2. When i upgrade FF it doesn't work as expected.