I have found the same thing on Internet Explorer 8 when attempting to click links using .Click()
- even though I can see Selenium clicking on the link. From my experience it appears that if the browser does not have focus then the initial click doesn't work.
A workaround to this is to send a .Click()
to another element on the page, so that the browser gets the focus, before attempting to click the link, e.g. it's parent:
Driver.FindElement(By.Id("Logout")).FindElement(By.XPath("..")).Click();
Driver.FindElement(By.Id("Logout")).Click();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…