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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With