Headless test automation with Firefox using Xvfb o

2019-09-10 01:21发布

I am trying to use Xvfb with firefox to run test automation headless. However, I am getting the following message on starting xvfb.

XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
_XSERVTransOpen: transport open failed for inet6/cvms1247:99
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension GLX

Then I tried the following command:

  Xvfb :001 -nolisten inet6
  export http_proxy=http-proxy.nwie.net:8080

The following message disappeared.

  XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
 _XSERVTransOpen: transport open failed for inet6/cvms1247:99
 _XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6

The usage of headless:

  if OS::windows? || ENV['PhantomJS'] == 'true'
    browser = Selenium::WebDriver.for :remote, url: 'http://localhost:8001'
  elsif OS::linux?
    require 'headless'
    headless = Headless.new
    headless.start
    browser = Selenium::WebDriver.for :firefox
    at_exit do
      browser.close
      headless.destroy
    end
  else
    raise 'Unknown OS'
  end

Environment:

 Ruby: 1.9.3
 Jenkins: 1.58
 Selenium webdriver: 2.53
 headless: 2.3.1
 Xvfb: yum install xorg-x11-server-Xvfb
 firefox: 33.0
 Linux: 2.6.32-573.12.1.el6.x86_64

What am I missing?

1条回答
Viruses.
2楼-- · 2019-09-10 02:13

There is no error, or you forgot to include it.

The example output you posted does not contain the word "error".

You might be misled by the "Unable to open socket for inet6" message(s). To me this looks like informational messages that ipv6 will not be used by this x server. Initialization after that succeeds, so most likely ipv4 worked ok or something.

查看更多
登录 后发表回答