Processing
 

Selenium FirefoxDriver in Headless get error

28/10/2014 23:33#1

NeoRamza

Member

Joined at: 7 months ago

Post: 1

Thank: 0

Thanked: 0

I'm getting the following error when I try to open the Firefox in headless mode:

Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:  (process:27527): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed Xlib: extension "RANDR" missing on display ":1".  (firefox:27527): GConf-WARNING **: Client failed to connect to the D-BUS daemon: Failed to connect to socket /tmp/dbus-VBJDTHN8W2: Connection refused Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:03:00' System info: host: 'cpro22808', ip: '176.153.5.11', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-32-generic', java.version: '1.7.0_55'  Driver info: driver.version: FirefoxDriver 

I'm using Ubuntu 14.04, Firefox 33, Selenium 2.44, Tomcat7, Xvfb.

I'm starting the Xvfb like that:

Xvfb :1 -ac -screen 0 1024x768x24 

My java code:

String Xport = System.getProperty("lmportal.xvfb.id", ":1"); FirefoxBinary firefoxBinary = new FirefoxBinary(); firefoxBinary.setEnvironmentProperty("DISPLAY", Xport); webDriver = new FirefoxDriver(firefoxBinary, null); 

I spent several days on this and tried a lot of things and nothing solve. Can someone help me?

13/07/2016 15:19Top#2

Joined at: 7 months ago

Post: 1

Thank: 0

Thanked: 0

I was also facing the same problem. This is what I did and the problem is gone.

  1. Delete /var/lib/dbus/machine-id. It will recreate a correct one on its one.
  2. export $(dbus-launch) and export NSS_USE_SHARED_DB=ENABLED. Set these environment variables and then re-run.

The issue was gone in my case.

Similar articles

Non-interactive method for dpkg-reconfigure tzdata

5 years ago - Reply: 3 - Views: 142

monit is not able to read mongod.lock

2 years ago - Reply: 3 - Views: 139

Ubuntu: hadoop command not found

2 years ago - Reply: 4 - Views: 244

C# Mono Console.ReadLine quitting

4 years ago - Reply: 1 - Views: 87

linking jsoncpp on Ubuntu

2 years ago - Reply: 1 - Views: 6

Build artifacts over ssh jenkins - PHP

2 years ago - Reply: 1 - Views: 38

Can't load Metasploit after installation

3 years ago - Reply: 5 - Views: 222

Selenium FirefoxDriver in Headless get error

2 years ago - Reply: 1 - Views: 96

Unable to start MongoDB. ERROR: addr already in use

2 years ago - Reply: 2 - Views: 120

ZSH Agnoster Theme showing machine name

2 years ago - Reply: 4 - Views: 248

Unable to start firefox browser with jenkins user

2 years ago - Reply: 2 - Views: 111

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re