the watir-webdriver scripts not running on firefox8: receiving "unable to obtain stable firefox connection in 60 seconds"

2,620 views
Skip to first unread message

Cristina Dumitrescu

unread,
Nov 9, 2011, 1:07:32 PM11/9/11
to watir-...@googlegroups.com

Hi,

I've update the firefox to the latest version ff8.

And I cannot run the scripts because I am receiving
Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)

irb(main):002:0> browser = Watir::Browser.new:ff
Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/firefox/launcher.rb:77:in `conn
ect_until_stable'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/firefox/launcher.rb:37:in `bloc
k in launch'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `l
ocked'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/firefox/launcher.rb:32:in `laun
ch'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/firefox/bridge.rb:19:in `initia
lize'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/common/driver.rb:29:in `new'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/common/driver.rb:29:in `for'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver.rb:81:in `for'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.8/lib/watir-webdriver/browser.rb:35:in `initialize'
        from (irb):2:in `new'
        from (irb):2
        from C:/Ruby192/bin/irb:12:in `<main>'


Does anyone know how to fix that?

Best regards,
Cristina

Cristina Dumitrescu

unread,
Nov 9, 2011, 1:12:06 PM11/9/11
to watir-...@googlegroups.com

Jari Bakken

unread,
Nov 9, 2011, 1:12:06 PM11/9/11
to watir-...@googlegroups.com
Hi,

a. Your selenium-webdriver gem is 3 versions old (latest release is 2.10). If you update your browser and something is not working, making sure you have the latest selenium-webdriver gem is always a good first step.

b. The next version of the selenium-webdriver gem (2.12.0 since the Ruby bindings skipped the 2.11 release) will support Firefox 8. Should be released either today or tomorrow.


bryan rasmussen

unread,
Dec 28, 2011, 9:15:34 AM12/28/11
to watir-...@googlegroups.com
Hi,

I'm running into that same problem myself. I originally
unable to obtain stable firefox connection in 60 seconds with Firefox
8 on Linux.

I just updated all my gems so I have

actionmailer (3.1.3, 3.1.1)
actionpack (3.2.0.rc1, 3.1.3, 3.1.1)
activemodel (3.2.0.rc1, 3.1.3, 3.1.1)
activerecord (3.1.3, 3.1.1)
activerecord-jdbc-adapter (1.2.1, 1.2.0)
activerecord-jdbcsqlite3-adapter (1.2.1, 1.2.0)
activerecord-oracle_enhanced-adapter (1.4.0)
activeresource (3.1.3, 3.1.1)
activesupport (3.2.0.rc1, 3.1.3, 3.1.1)
acts_as_list (0.1.4)
arel (2.2.1)
bouncy-castle-java (1.5.0146.1)
builder (3.0.0)
bundler (1.0.21 ruby)
childprocess (0.2.4, 0.2.3, 0.2.2)
cucumber (1.1.4, 1.0.2)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.2.13, 1.2.9)
ffi (1.0.11 java, 1.0.9 java)
gherkin (2.7.1 java, 2.4.16 java)
hike (1.2.1)
i18n (0.6.0)
jdbc-sqlite3 (3.7.2)
journey (1.0.0.rc3)
jquery-rails (2.0.0, 1.0.16)
jruby-launcher (1.0.9 java java)
jruby-openssl (0.7.4)
json (1.6.4 java, 1.6.1 java, 1.5.3 java)
json_pure (1.6.4, 1.6.3, 1.5.3)
liquid (2.3.0)
mail (2.3.0)
mime-types (1.17.2)
multi_json (1.0.4, 1.0.3)
polyglot (0.3.3)
rack (1.4.0, 1.3.5)
rack-cache (1.1)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.3, 3.1.1)
railties (3.2.0.rc1, 3.1.3, 3.1.1)
rake (0.9.2.2, 0.9.2, 0.8.7)
rdoc (3.12, 3.11)
rsolr (1.0.6, 1.0.3)
rsolr-ext (1.0.3)
rspec (2.7.0, 2.6.0)
rspec-core (2.7.1, 2.6.4)
rspec-expectations (2.7.0, 2.6.0)
rspec-mocks (2.7.0, 2.6.0)
ruby-plsql (0.4.4)
rubyzip (0.9.5, 0.9.4)
sass (3.1.12, 3.1.10)
sass-rails (3.2.2, 3.1.4)
selenium-webdriver (2.15.0, 2.5.0)
sprockets (2.1.2, 2.0.3)
term-ansicolor (1.0.7, 1.0.6)
therubyrhino (1.73.0, 1.72.8)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31, 0.3.30)
uglifier (1.2.1, 1.0.4)
watir-webdriver (0.4.1, 0.3.8, 0.3.2)
will_paginate (3.0.2)

and am still getting that error.
Anything else that could be leading to it.


Thanks,
Bryan Rasmussen

Željko Filipin

unread,
Dec 28, 2011, 9:21:16 AM12/28/11
to watir-...@googlegroups.com
On Wed, Dec 28, 2011 at 3:15 PM, bryan rasmussen <rasmuss...@gmail.com> wrote:
> and am still getting that error.

Please post your code and error message.

Željko
--
watir.com/book - author

bryan rasmussen

unread,
Dec 28, 2011, 10:21:38 AM12/28/11
to watir-...@googlegroups.com
I really don't know what part of the code to post - it's pretty
sparse. I've had this working in older versions of firefox and in
chrome - although currently having chromedriver problems as well there
have been no code change that would explain a change to functioning of
the tests.

I run the command
/usr/share/ruby-rvm/rubies/jruby-1.6.5/bin/jruby -S bundle exec
cucumber SITE=http://localhost:3456 --tags @dk --profile default

this is where I get the browser
Before do
browser_type = 'firefox'
$browser ||= Watir::Browser.new browser_type.to_sym
end

I have the following


def login_dk
unless($browser.url[$SITE])
$browser.goto "#{$SITE}/login?pwd=11901245&uid=10096501"
end
end


Before '@dk' do
login_dk if ARGV.join('|').include?('@dk')
end

the login_dk url actually works.

I have a cucumber scenario

@dk
Scenario: Document display by topid and versid
#ARTIKEL TEST
Given I am viewing topid "7000401342" with versid "578-1-2009"
When I look at the page
Then the page should display nicely
And the text "Frivillige forlig og lov om kreditaftaler" should be visible

which when run returns

@dk
Scenario: Document display by topid and versid
# features/document_display.feature:15
undefined method `url' for nil:NilClass (NoMethodError)
/home/vagrant/repositories/karnov/KMPOnline/LegalTests/features/support/env.rb:22:in
`login_dk'
/home/vagrant/repositories/karnov/KMPOnline/LegalTests/features/support/env.rb:29:in
`Before'


unable to obtain stable firefox connection in 60 seconds

(127.0.0.1:7056) (Selenium::WebDriver::Error::WebDriverError)
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver/firefox/launcher.rb:77:in
`connect_until_stable'
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver/firefox/launcher.rb:37:in
`launch'
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in
`locked'
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver/firefox/launcher.rb:32:in
`launch'
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver/firefox/bridge.rb:19:in
`initialize'
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver/common/driver.rb:29:in
`for'
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver.rb:81:in
`for'
/usr/share/ruby-rvm/gems/jruby-1.6.5/gems/watir-webdriver-0.3.8/lib/watir-webdriver/browser.rb:35:in
`initialize'
/home/vagrant/repositories/karnov/KMPOnline/LegalTests/features/support/hooks.rb:6:in
`Before'
Given I am viewing topid "7000401342" with versid "578-1-2009"
# features/step_definitions/documents.rb:19
When I look at the page
# features/step_definitions/general_navigation.rb:48
Then the page should display nicely
# features/step_definitions/documents.rb:25
And the text "Frivillige forlig og lov om kreditaftaler" should be
visible # features/step_definitions/general_navigation.rb:102


The code that is pointed to there is

/home/vagrant/repositories/karnov/KMPOnline/LegalTests/features/support/hooks.rb:6:in
`Before' -> the first bit of code pointed to

the bits in /home/vagrant/repositories/karnov/KMPOnline/LegalTests/features/support/env.rb:22:in
`login_dk'
/home/vagrant/repositories/karnov/KMPOnline/LegalTests/features/support/env.rb:29:in
`Before'


are the ones shown above.

firefox is found in the following manner on my system

/usr/bin/firefox - /usr/bin is on my path
it is a symbolic link to ../lib/firefox-8.0/firefox.sh

at any rate that all seems to work since whenever I run my tests,
firefox starts. It just doesn't get automated after that initial
start.

thanks,
Bryan Rasmussen

Željko Filipin

unread,
Dec 28, 2011, 10:27:11 AM12/28/11
to watir-...@googlegroups.com
On Wed, Dec 28, 2011 at 4:21 PM, bryan rasmussen <rasmuss...@gmail.com> wrote:
> I really don't know what part of the code to post

Try this in IRB and let us know what happens (including error messages):

require "watir-webdriver"
browser = Watir::Browser.new :firefox
browser.goto "google.com"



>  undefined method `url' for nil:NilClass (NoMethodError)

Looks like you are calling "url" method on a variable that points to nil.

Željko

Jari Bakken

unread,
Dec 28, 2011, 10:54:05 AM12/28/11
to watir-...@googlegroups.com
On Wed, Dec 28, 2011 at 4:21 PM, bryan rasmussen <rasmuss...@gmail.com> wrote:
 unable to obtain stable firefox connection in 60 seconds
(127.0.0.1:7056) (Selenium::WebDriver::Error::WebDriverError)
 /usr/share/ruby-rvm/gems/jruby-1.6.5/gems/selenium-webdriver-2.5.0/lib/selenium/webdriver/firefox/launcher.rb:77:in
`connect_until_stable'

This stacktrace indicates you're running selenium-webdriver 2.5.0. Support for Firefox 8 was added in 2.12.0:


Jari 

Chuck van der Linden

unread,
Dec 28, 2011, 11:54:34 AM12/28/11
to Watir General
On Dec 28, 7:27 am, Željko Filipin <zeljko.fili...@wa-research.ch>
wrote:
> On Wed, Dec 28, 2011 at 4:21 PM, bryan rasmussen <rasmussen.br...@gmail.com>
> wrote:
>
> > I really don't know what part of the code to post
>
> Try this in IRB and let us know what happens (including error messages):
>
> require "watir-webdriver"
> browser = Watir::Browser.new :firefox
> browser.goto "google.com"
>
> >  undefined method `url' for nil:NilClass (NoMethodError)
>
> Looks like you are calling "url" method on a variable that points to nil.
>

Yep his login_dk method does that in its first line

unless($browser.url[$SITE])

seems like at that point the browser object in ruby is not really
fully created and connected to FF, so the .url method is not valid.

Starting FF is only half of what is needed, once it starts Webdriver
needs to connect to the browser instance, and that appears to be where
it is having trouble based on the error message that it was unable to
establish a connection. If it does not have the connection then Watir-
webdriver cannot create a proper browser object, which would explain
the issue with trying to use the .url method at that point in your
scripts.

Looking at the errors, it seems like it is trying to run code from
selenium-webdriver-2.5, which is not the version you want since it
barely supports FF6 and is several months before they added support
for FF8. (you want 2.12 or above, preferably the current version
which is 2.15.0 as I type this). So the first thing I would try is to
use 'gem uninstall' to remove that version of selenium-webdriver.

This is ultimately an issue with firefox and webdriver. If getting
that 2.5 version of of the way does not solve it then check your FF
version to be double sure you are really running FF8. The FF people
just released FF9 so potentially your system may have updated
automagically without your knowing it? I see a number of reports in
Selenium support fora related to FF9 and 2.15 not working for them and
fixing it by rolling their FF back to 8, so I'd be checking that first
off to be really sure that's not your problem.

The latest release of webdriver (dec 8th, 2.15.0 See changelog here:
http://selenium.googlecode.com/svn/trunk/rb/CHANGES) claims to support
FF up through 11 (they must have a time machine). But as I just
mentioned it does not appear to work for some people with FF9, so I
suspect there are some issues to be resolved yet. (perhaps on
platforms the developers did not test against?)

{soapbox} The way they are churning through major version numbers
I'm beginning to suspect that FF development is moving too fast for
the market. It's too hard for everyone else to keep up, be it third
party add-ons, QA tools like webdriver, or gods help them corporate IT
departments who barely finish testing one new version before another
comes out. A large number of users are refusing to upgrade due to
their favorite addon being broken etc. It's pushing people away (FF
market share is shrinking, and according to W3schools (http://
www.w3schools.com/browsers/browsers_stats.asp) chrome is now only
about 5% behind FF. The statcounter numbers are very different
(http://gs.statcounter.com/) as they still have IE on top, but they
show chrome now having passed FF, and show even greater fragmentation
for FF users especially for the NorthAmerican market.) It's been bad
enough trying to get people off of IE6 and IE7 but now it's starting
to look like FF3.6 will become the next 'browser that won't die' and
if I want to test anything with more than 5-6% of the market that my
matrix will do nothing but get bigger all the time. {/soapbox}

For us QA folks this is a royal PITA since we need to test what
users are using, and that now means multiple versions of FF which
increases our text matrix and test costs.


Reply all
Reply to author
Forward
0 new messages