Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xvfb install on Linux

I am trying to get Selenium to do some automated browsing on a Linux application server. I am stuck at the point where my 'perl recording' from Selenium sends a request to start the browser, and the standalone selenium server throws an error - 'Timed out waiting for profile to be created!'.

I understand from browsing this error, that I could resolve this by creating a profile for the firefox browser I installed on the linux server. However, when I try to create a profile, I now get the error -

Error: no display specified

When I look this up, I find SO posts that suggest I could resolve this by installing xvfb first on the server and then setting the DISPLAY variable before starting the selenium server. However, I am not a root user, and wanted to check if xvfb can be installed locally on a user's home directory.

like image 345
gizmodo Avatar asked Oct 01 '13 23:10

gizmodo


People also ask

What is XVFB Ubuntu?

Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory. The primary use of this server was intended to be server testing.

What is XVFB server?

Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol. In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output.


1 Answers

First need to install X window system frame buffer x server:

yum install xorg-x11-server-Xvfb.x86_64

make sure you have firefox installed, then start the x server on some display port like 99

Xvfb :99 -ac -screen 0 1280x1024x24 &

Set the DISPLAY environment to 99 by export DISPLAY=:99 in your code or maybe in bash profile.

like image 110
Mahattam Avatar answered Sep 22 '22 17:09

Mahattam