selenium - Unable to click on Sub menu link after mouse hover in Internet Explorer -
i have click on sub menu link, displayed after hovering mouse on main menu.
below code work on firefox:
actions builder = new actions(driver); webelement = driver.findelement(by.id("menumaincontracts")); builder.movetoelement(we).perform(); thread.sleep(2000); webelement sublink = driver.findelement(by.id("mnusubcontracts")); builder.movetoelement(sublink).click().build().perform();
but in internet explorer not click on sub menu link, instead tries click on main menu itself.
it not show error message also. please rid of issue.
there can 2 chances.
1.your application frontend design may restrict ie support. can odd or classy framework might used.
2.in case, if able perform same in manual, need have proper approach. try following,
actions builder = new actions(driver); webelement = driver.findelement(by.id("menumaincontracts")); builder.movetoelement(we).build().perform(); // have missed build here ! thread.sleep(2000); webelement sublink = driver.findelement(by.id("mnusubcontracts")); builder.movetoelement(sublink).click().build().perform();
or
actions builder = new actions(driver); webelement = driver.findelement(by.id("menumaincontracts")); webelement sublink = driver.findelement(by.id("mnusubcontracts")); builder.movetoelement(we).click().movetoelement(sublink).click().build().perform();
i have other suggestions well, try call excepted conditions in middle of these advance actions.(in case, waiting sub menu appeared). haven't tried them. may technically fatal one. try , keep community posted on outcomes.
Comments
Post a Comment