java - Webdriver:Element is not currently visible and so may not be interacted with. -
on web-page have username dropdown list when take mouse on logout option , user able logout. while automating, logout link hidden, webdriver not able interact it. please suggest solutions.
use actions
class mousehover , then, when logout link visible click on it. can use below code reference.
actions actions = new actions(driver); //for hovering on username field webelement menuhoverlink = driver.findelement(by.linktext("username")); actions.movetoelement(menuhoverlink).perform(); //for clicking logout link webelement logoutlink = driver.findelement(by.linktext("logout")); logoutlink.click();