I have a complex epiphany web application which is only IE compatible. Here are the sequence of actions on the UI:
The page has multiple frames, out of which there is a Button which when clicked on presents a set of menu options. And the HTML for them is as below :
<div class="FWDropdownMenu" id="test_dropdown">
<div class="DropdownMenuFrame">
<table>
<tbody>
<tr>
<td>
<span class="eABCD" id="e1">
<div class="DropdownMenuItem" id="test2_dropdown" onclick=return eTop.Fire(1,this,event)">
<table>
<tbody>
<tr>
<td>
<div>Option 1</div>
</td>
</tbody>
</table>
</div>
I want to click on Option 1, so i was using this to locate the element :
List<WebElement> options = driver.findElements(By.tagName("table")
.tagName("td").id("e1"));
The Webdriver is able to get the element, but not able to click on it. I was getting error as element not visible, but even when the options are presented on screen through click on menu options, i am still not able to click it.
Any thoughts/suggestions?
For me it seems, you haven't used correct element locator. As per you question you want to click on
Option 1
and you are selecting element by ide1
. which will click on below html element<span class="eABCD" id="e1">
I'd prefer to use simple locator like this:
driver.findElement(By.xpath("//div[contains(text(),'Option 1')]")).click();