views:

30

answers:

0

I have setup cucumber+webrat+selenium to test my rails app. This works well locally, and works about 50% of the time on my build (CI) server.
The other 50% of the time, the first scenario in each feature fails with this error:

Failed to start new browser session, shutdown browser and clear all session data

Back trace starts with:

org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'null' to appear
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:569)

Ruby portion of the error starts with:

"Failed to start new browser session: Error while launching browser"
called from /usr/local/lib/ruby/1.9.1/timeout.rb:52:in `timeout'

And seems to come from:

./vendor/plugins/webrat/lib/webrat/selenium/selenium_session.rb:230:in `setup'
./vendor/plugins/webrat/lib/webrat/selenium/selenium_session.rb:195:in `selenium'
./vendor/plugins/webrat/lib/webrat/selenium/selenium_session.rb:46:in `visit'

I'm pretty thoroughly at a loss, I traced through the relavant ruby code, but it seems like the problem occurs in selenium's Java code. Having not written or wanted to write, much less debug unknown, Java in the two years since I left college, I am hoping someone might know the cause/solution to this problem.
The fact that this occurs only 50% of the time + the fact that the ruby portion of the error comes out of timeout.rb makes me suspect a longer timeout during some part of initialization would solve this, but I can't seem to trackdown where.

Have not worked with selenium before, so if more info is required let me know and I will post what I can.