Wednesday, 29 April 2009

We've got a project with quite a large set of tests, and we have both Firefox and IE7 continuous builds using selenium. The annoying thing is that something that takes 5 minutes in Firefox can take 30+ minutes with IE (I kid you not!).

It turns out this is a common problem and is due to the lack for native xpath support in IE. So for all the selenium tests that use xpath=//..... in IE the xpath is actually being evaluated using javascript ... ouch. An alternative is to use css locators, you can't do this everywhere but as well as improving the IE performance it can also provide some rather tidy rules. For example

The duration for each step has been appended to the NEXT log line, i.e. setUpConversationsForSearch took 16638msThe next step is to parse this file into something readable. We wrote a groovy script (see below), which generates output like: