Sunday, 15 September 2013

html - Unable to click SubMenu using selenium web driver -



html - Unable to click SubMenu using selenium web driver -

i exploring options automate ui application. have menu display sub menu on mouse on . unable click on sub menu items.

below html code. <table class="mnuadmin_2" id="mnuadmin" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td id="mnuadminn0" onmouseover="menu_hoverstatic(this)" onmouseout="menu_unhover(this)" onkeyup="menu_key(this)"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td style="white-space: nowrap;"> <a class="mnuadmin_1" style="cursor: text;" href="#"> <img style="vertical-align: middle; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none;" alt="" src="images/icon_administration.gif" /> administration</a> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="mnuadmin_0 dynamicmenu mnuadmin_5" id="mnuadminn0items" style="left: 165px; top: 23px; height: 101px; display: inline; visibility: visible; z-index: 100; clip: rect(auto, auto, auto, auto);"> <table style="top: 0px;" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 1px;"> <td></td> </tr> <tr title="test1" id="mnuadminn1" onmouseover="menu_hoverdynamic(this)" onmouseout="menu_unhover(this)" onkeyup="menu_key(this)"> <td> <table width="100%" class="mnuadmin_4" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td style="width: 100%; white-space: nowrap;"> <a class="mnuadmin_1 mnuadmin_3" href="javascript:opennewtabs(' test1.aspx', ' test1', ' test1', false)"> <div class="menupadding"> test1 </div> </a> </td> </tr> </tbody> </table> </td> </tr> <tr style="height: 1px;"> <td></td> </tr> <tr style="height: 1px;"> <td></td> </tr> <tr title="manage nice group" id="mnuadminn2" onmouseover="menu_hoverdynamic(this)" onmouseout="menu_unhover(this)" onkeyup="menu_key(this)"> <td> <table width="100%" class="mnuadmin_4" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td style="width: 100%; white-space: nowrap;"> <a class="mnuadmin_1 mnuadmin_3" href="javascript:opennewtabs('test2.aspx', 'test2', 'test2', false)"> <div class="menupadding"> test2 </div> </a> </td> </tr> </tbody> </table> </td> </tr> <tr style="height: 1px;"> <td></td> </tr> <tr style="height: 1px;"> <td></td> </tr> <tr id="mnuadminn3" onmouseover="menu_hoverdynamic(this)" onmouseout="menu_unhover(this)" onkeyup="menu_key(this)"> <td> <table width="100%" class="mnuadmin_4" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td style="width: 100%; white-space: nowrap;"> <a class="mnuadmin_1 mnuadmin_3" style="cursor: text;" href="#"> <div class="menupadding"> test3 </div> </a> </td> <td style="width: 0px;"> <img style="vertical-align: middle; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none;" alt="expand" src="/abc/webresource.axd? d=q47az1x7loap01dstai2pdvm8t2pm3 zbtft7sah9glczvljgu_o4sclltcdwejo 5hwzg0zvgfoijikirbgvvmaah_spy2- yjejh4osaw2xbzoqmk0&t=635294807132453548" /> </td> </tr> </tbody> </table> </td> </tr> <tr style="height: 1px;"> <td></td> </tr> <tr style="height: 1px;"> </tr> </tbody> </table> </div>

i have tried next 2 options.

var element = driverie.findelement(by.linktext("administration")); actions action = new actions(driverie);

action.movetoelement(element).build().perform(); driverie.findelement(by.linktext("test2")).click();

try next :

action.movetoelement(element).perform();

thread.sleep(5000l);

driverie.findelement(by.linktext("test2")).click();

i think should give seconds sub menu open.

html css selenium

No comments:

Post a Comment