I have a JavaScript hidden drop down menu that doesn't display the links unless the mouse hovers over it. I am trying to select a link within this menu using ruby watir-webdriver. I can select the link using .hover that shows the contents in the drop down menu. But I am having trouble selecting any of the links within the menu. In this case I want to click on the link "item1". Here is the html code:
<script type="text/javascript">
<div id="menuWHeader" class="menuWf">
<span class="menuTitle" onclick="goWindow(oprWin)" onmouseout="menuCollapse('menuWContent')" onmouseover="menuExpand('menuWContent')"> window </span>
<table id="menuWContent" class="menuContent" onmouseout="menuCollapse("menuWContent")" onmouseover="menuExpand("menuWContent")" style="visibility: hidden;">
<tbody>
<tr>
<td class="menuItemNormal" onclick="goWindow(oprWin)" onmouseout="menuNormal(this)" onmouseover="menuSelect(this)">
<img id="imgMenuWindow1" alt="" src="https://<myurl>/images/check-none.gif">
item1
</td>
</tr>
<tr style="display:none">
<td onclick="goWindow(crtWin)" onmouseout="menuNormal(this)" onmouseover="menuSelect(this)">
<img id="imgMenuWindow2" alt="" src="https://<myurl>/images/check-none.gif">
item2
</td>
</tr>
<tr>
<td class="menuItemNormal" onclick="goWindow(libWin)" onmouseout="menuNormal(this)" onmouseover="menuSelect(this)">
<img id="imgMenuWindow3" alt="" src="https://vts42.commstor.crossroads.com/images/check-none.gif">
item3
</td>
</tr>
The second table row item "item2" is hidden and does not display on the menu(greyed out in code). So only item1 & item3 are visible on the menu when I hover over it.
As mentioned I can hover on "window" which is the title of this menu and this then displays the menu items. I just cannot select any of the items in the list. Right now I am just trying to select item1. below is the watir code to hover on the menu.
wb.div(:id => 'menuWHeader').span(:class =>'menuTitle').hover
I have tried a bunch of stuff that hasn't worked so I don't see any point in posting my failed attempts. Any help is appreciated.