0

Gems in use:

  • watir-webdriver-0.6.2
  • selenium-webdriver-2.27.2

Using Firefox 16.0.2 on all systems.

Situation: We have a modal window that closes after we run

link(:text, 'Continue').click

System 1: Hardware Overview:

  • Model Name: MacBook Air
  • Model Identifier: MacBookAir4,2
  • Processor Name: Intel Core i5
  • Processor Speed: 1.7 GHz
  • Number of Processors:1
  • Total Number of Cores: 2
  • Memory: 4 GB
  • OS: OS X 10.8.2

System 1 Result: Always succeeds

System 2:

  • Model Name: MacBook Pro
  • Model Identifier: MacBookPro10,1
  • Processor Name: Intel Core i7
  • Processor Speed: 2.3 GHz
  • Number of Processors: 1
  • Total Number of Cores: 4
  • Memory: 16 GB
  • OS: OS X 10.8.2

System 2 Results: Executes the click and then after the specified time throws a Timeout::Error.

A Middle system (sorry I don't have the full specs available) is a new Mac Mini also with Mountain Lion. This system WAS failing until while trying to track this down, I added a puts statement at the specific call that produced the timeout. This led, of course, to a constant success state, which indicated what we fondly call a Heisenerror.

The puts statement was added in the selenium-webdriver code in lib/selenium/webdriver/remote/bridge.rb around line 613 and looked like:

puts "-> #{verb.to_s.upcase} #{path}" if verb.to_s.upcase == 'POST'

This prints out all of the post requests made to the browser. The specific post request that timesout is one of the click requests. I don't have the full path, but will add it on Monday if it is required.

Does anybody know how to circumvent system-dependent timeouts with watir/selenium?

wkl
  • 77,184
  • 16
  • 165
  • 176
Kris Robison
  • 698
  • 7
  • 13

1 Answers1

1

Maybe use wait_until method for waiting loading page

wait_until(:timeout => 20) { page.current_url =~ /some_url/ }

http://rubydoc.info/github/moredip/Frank/master/Frank/Cucumber/WaitHelper.wait_until

and then

find(".some_class").find('a', :text => /Continue/).click
avokhmin
  • 161
  • 1
  • 7
  • There isn't a change in URL to wait for. So instead I did a wait_until (timeout: 30) { link(text: 'Continue').present? && link(text: 'Continue').visible? } link(text: 'Continue').click Same result. – Kris Robison Jan 21 '13 at 21:39