문제

I am trying to get cucumber tests to run on our headless centOS box. I have installed Xvfb, firefox, and my test suite, which functions on our non-headless(headed?) machines.

Versions

CentOS: 6.2
firefox: 23.0.1
headless: 1.0.1
selenium-webdriver: 2.35.0
watir-webdriver: 0.6.4
ruby: 1.9.3

In irb:

1.9.3-p448 :001 > require 'watir-webdriver'
 => true
1.9.3-p448 :002 > require 'headless'
 => true
1.9.3-p448 :004 > headless = Headless.new
 => #<Headless:0x000000025e0860 @display=99, @autopick_display=true, @reuse_display=true, @dimensions="1280x1024x24", @video_capture_options={}, @destroy_at_exit=true>
1.9.3-p448 :005 > headless.start
 => #<Proc:0x000000025e5180@/usr/local/rvm/gems/ruby-1.9.3-p448/gems/headless-1.0.1/lib/headless.rb:175>
1.9.3-p448 :006 > b = Watir::Browser.new(:firefox)
Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver/firefox/launcher.rb:79:in `connect_until_stable'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver/firefox/launcher.rb:37:in `block in launch'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver/firefox/launcher.rb:32:in `launch'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver/firefox/bridge.rb:24:in `initialize'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver/common/driver.rb:31:in `new'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver/common/driver.rb:31:in `for'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.35.0/lib/selenium/webdriver.rb:67:in `for'
        from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/watir-webdriver-0.6.4/lib/watir-webdriver/browser.rb:46:in `initialize'
        from (irb):6:in `new'
        from (irb):6
        from /usr/local/rvm/rubies/ruby-1.9.3-p448/bin/irb:13:in `<main>'

I have the same issue when trying to run the tests (this is just easier to reproduce).

I checked out the other questions here, but I am already using the latest version. According to the changelog they support firefox 23. Does anyone have any ideas? Thanks in advance!

UPDATE 8/28/2013 0900: I was getting this error when I tried to run Xvfb.

[dix] Could not init font path element catalogue:/etc/X11/fontpath.d, removing from list!
[dix] Could not init font path element built-ins, removing from list!

I fixed it by using

yum -y install libXfont

But I am still getting the same error.

UPDATE 8/28/2013 0930: As per TDHM's suggestion, I downgraded firefox to 17.0.8 by running

yum downgrade firefox

But I am still getting the same error.

도움이 되었습니까?

해결책

A co-worker of mine managed to fix the issue. Run this line of code:

$ dbus-uuidgen > /var/lib/dbus/machine-id

And the problem is fixed. This is the source for the fix

다른 팁

I'm not sure, but see if downgrading Firefox version works. Because many times latest version of Selenium has problems with latest browser versions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top