I am trying to click a hover over 'edit' button. However, I keep getting "Element is not currently visible and so may not be interacted with" Error when I use mouseOverElement.
Any idea on how to make it work? Thanks
< div class="editbox" >
< h2>Title< /h2>
< ul>
< li >
< small class="editlinks" >
< a class="edit" href="#">Edit< / a >
< /small>
< strong> Content
< /li>
< /ul>
< /div>
Here is my code:
Approach 1:
WebElement textArea = driver.findElement(By.cssSelector("div.editbox ul li"));
WebElement button = driver.findElement(By.cssSelector("div.editbox ul li small.editlinks a.edit"));
Actions builder = new Actions(driver);
builder.moveToElement(textArea).build().perform();
timer.wait(5000);
driver.findElement(By.cssSelector("div.editbox ul li small.editlinks a.edit")).clik();
Approach 2:
Actions builder = new Actions(driver);
builder.moveToElement(textArea);
timer.wait(5000);
builder.click(button);
builder.build().perform();