When using the IE driver with IE9, occasionally the Click method will only select a button, it wont do the action of the Click(). Note this only happens occasionally, so i don't think it is the code that is the problem. Using the Firefox driver with Firefox4 has no problems. I am also having an issue where elements are not being found occasionally too, but only in IE again, not Firefox.
if (Driver.FindElement(By.Name("username")) == null) {
//sometimes gets here in IE, never gets here in Firefox
}
Driver.FindElement(By.Name("username")).SendKeys(username);
Driver.FindElement(By.Name("surname")).SendKeys(surname);
Driver.FindElement(By.Name("firstname")).SendKeys(firstname);
string url = Driver.Url;
Driver.FindElement(By.Name("cmd")).Click();
if (Driver.Url == url) {
//if the page didnt change, click the link again
Driver.FindElement(By.Name("cmd")).Click();
}
I have seen this similar questions (https://mcmap.net/q/392876/-selenium-webdriver-ie-button-issue), but i do not have dynamicly generated ids.