c# - Menu and SubMenu in different frames -


i have little problem clicking on submenu, reason menu tag in 1 frame , submenu in other when switch other frame submenu invisible

my code:

driver.switchto().defaultcontent().switchto().frame("top");  actions actions = new actions(driver); iwebelement menuhoverlink = driver.findelement(by.partiallinktext("cons")); actions.movetoelement(menuhoverlink); actions.build().perform();  driver.switchto().defaultcontent().switchto().frame("content").findelement(by.id("elem3")).click(); 

exception

unexpected error. element not visible , may not interacted with

does have idea can in case?

thanks.

try use explicit wait

driver.switchto().frame("content"); webdriverwaitwait wait = new webdriverwait(driver, timespan.fromseconds(10)); wait.until(expectedconditions.elementisvisible(by.id("elem3"))).click(); 

or use send keys

actions.movetoelement(menuhoverlink).build().perform();          menuhoverlink.sendkeys(openqa.selenium.keys.arrowdown); menuhoverlink.sendkeys(openqa.selenium.keys.enter); 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -