My list is nested under two headers and I don't know how to access them via watir since the style, display is set to "none" until a "hover" event occurs. And the class isn't defined until a hover/mousveover either.
b.link(:text, /Assessments/).fire_event('onmouseover')
will open the initial drop-down. I have no idea how to access the elements in the "sub-level"
Variations on the following are rejected by watir:
b.link(:class, "sub-level").click
b.link(:class, "sub-level").fire_event('onmouseover')
b.link(:class, "sub-level").fire_event('hover')
Watir::Exception::UnknownObjectException: unable to locate element, using {:class=>"sub-level", :tag_name=>"a"}
I've been running this through IRB for quick testing of each new line I add to my script. If this is incorrect, I would appreciate any advice.
<li class="top-level">
<a class="" href="#">
Assessments
<img id="lfArrowImg" style="border:0px;" src="https://test.com/top/images/global_nav_downArrow.gif">
</a>
<ul style="z-index: 1045; display: none;">
<li class="sub-level">
<a class="">
Assessments
<div id="menugroup" class="dr-menu-node dr-menu-node-icon rich-menu-item-folder rich-menu-group-folder"></div>
</a>
<ul style="z-index: 1068; display: none;">
<li class="sub-level">
<a class="" href="http://test.com/content/aa/assessment/index.xhtml">Main</a>
</li>
<li class="sub-level">
<li class="sub-level">
</ul>
</li>
Thanks, Damien