selenium - how to hover over menu and sub menu -
with following code, able hover , click on 1 level hierarchic. ctl00_mnumainn2 -> new
public static void openfundnewpagetest() { navigatefrommainpage("td#ctl00_mnumainn2", "new"); //driver.findelement(by.linktext("new")).click(); waitforpageload(); } public static void navigatefrommainpage(string objectidentifier, string menulink) { string js = "$(" + "'" + objectidentifier + "'" + ").mouseover();"; ((ijavascriptexecutor)driver).executescript(js); driver.findelement(by.linktext(menulink)).click(); }
if there multiple level of submenu ctl00_mnumainn2 -> fund -> hierachi -> new
how can make them work?
also not able identify link on page.
you can use this
webutilities.executescript(driver, "$('.context_menu').show()");
replace '.context_menu' respective css selector.
then can find element , click it.
Comments
Post a Comment