Selenium 2.0b3 IE WebDriver, Click not firing

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();

Leave a Comment