Monday, August 1, 2016

Running Selenium in Headless Mode on Linux Host

If you want to run selenium on a remote linux machine, which does not have any display, you have the following options available:

Xvfb
(From Wikipedia) 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 memory without showing any screen output. Xvfb can be installed via the following command (tested on CentOS 7):
yum install xorg-x11-server-Xvfb
Once the installation is complete, you can start Xvfb by issuing following command:
Xvfb :99 &
Once the server is launched, export the DISPLAY environment variable so that other programs can find it:
export DISPLAY= :99
You should now be able to run your selenium tests.

XDummy
Xvfb is not maintained anymore. A more recent supported option is to use XDummy. It is a script developed by Karl Runge to allow a standard X11 server to be used by non-root users with the dummy video driver. If you want to use XDummy, follow the following steps: 1. Make sure you have gcc installed. 2. Download the XDummy script and execute it
wget http://www.karlrunge.com/x11vnc/Xdummy
chmod +x Xdummy
Xdummy :99 &
XDummy is a drop in replacement for Xvfb (at least from selenium perspective). I have used both Xvfb and XDummy, and found XDummy to be more stable. I have seen Xvfb crashing if I leave the tests running for a while.

Wednesday, October 21, 2009

Squirrel SQL Client Result Display

We all know Squirrel SQL Client is the number one SQL Client which can connect to a variety of databases and offers a intuitive user interface.
But I was just boggled by one of its drawbacks - everytime you issue a query it displays the results in a new tab. Even if you enter the same query again, it will display the results in a new tab.
By the time you have issued about 10-12 queries, it will just keep adding new tabs.
Well, this functionality might be useful for some users and might be seen as "good to have feature", but then there are people like me who are more interested in the principle of res usability :)
I searched through the Global Preferences and even tried to google for a solution, but did not find anything related to this. But surprisingly, the solution is simple enough and does not require any configuration at all!
Just right click on a open tab and select "Toggle Sticky"(the shortcut is Ctrl+Shift+Y) and BINGO!
Hope this will save somebody from brainstorming :)