I noticed a slight quirk between IE and Firefox when testing with Selenium the other day, which in retrospect makes sense; however, it serves to demonstrate the challenges of user acceptance testing in the face of a heterogeneous browsing community.

Firefox manipulation of form selections works via the type command of the DefaultSelenium object. For example, the following sequence of commands works with Firefox:

driver.open(appPath + "/CreateUser.html");
driver.type("name", "SpongeBob");
driver.type("genus", "Sponge"); //this only works with firefox
driver.click("submit");

As you can see from the code above, genus is the name of a selection element on a web form.

IE, however, doesn’t accept the type command within form sections– you must actually use the select method of the DefaultSelenium object as follows:

driver.open(appPath + "/CreateUser.html");
driver.type("name", "SpongeBob");
driver.select("genus", "Sponge");
driver.click("submit");

The fix, luckily, is to go with the code that works for IE as it’ll also work within Firefox. It goes to show you, however, that writing generic code to facilitate testing of web code that’ll be viewed by multiple browser types can be challenging. If you write some tests that work for one browser, don’t assume they’ll work for them all until you’ve actually tried.