I found watir-webdriver to be extremely slow locating an element by regexp on a very big page, this is at least true in FF 8.0.1 for me. Example on a flight search results page (containing about 50 search results, each of them is a good portion of html structure):
1.
irb(main):057:0>
t=Time.now;browser.div({:id=>”flightModule40”}).exists?;puts
”#{Time.now-t}” #=> 0.202
2.
irb(main):056:0>
t=Time.now;browser.div({:id=>/flightModule40/}).exists?;puts
”#{Time.now-t}” #=> 131.046
3.
irb(main):058:0>
t=Time.now;browser.div({:id=>/flightModule/, :index=>40}).exists?;puts
”#{Time.now-t}” #=>—is working for 30 minutes for me already…
All of the above works with acceptable speed in watir 1.6.5 and watir 2.0.4 in IE8.
For comparison, here are some times using watir-webdriver against IE8 and FF3.6
watir-webdriver on IE8:
- => 0.172017
- & 3. => Timeout::Error: execution expired from C:/ruby/1.8.7-p334/lib/ruby/1.8/timeout.rb:64:in `rbuf_fill'
watir-webdriver with FF3.6:
- => 0.055005,
- => 80.095009,
- => 101.734173.
Steps to get to the page under test - www.expedia.co.uk/Flights, do a roundtrip search for flights and switch to Return Flights tab on the results page.
Does any have any clue why this is happening?