Get SeleniumRC Browser Windows Out of Your Way

Here’s a way to stop annoying browser windows popping up and stealing your keyboard focus when running SeleniumRC tests.

  1. Install Xephyr.
    On Fedora: $ sudo yum install xorg-x11-server-Xephyr
    On Ubuntu: $ sudo apt-get install xserver-xephyr
  2. Start Xephyr.
    $ Xephyr :1 -ac -screen 1024x768 &
  3. Open a terminal in the Xephyr xserver.
    $ DISPLAY=:1 gnome-terminal &
  4. Start a window manager in the Xephyr server.
    $ DISPLAY=:1 metacity &
  5. From the terminal within the Xephyr window start SeleniumRC server.
  6. Run your tests. Now the browser will only pop up within the Xephyr window

Browser running SeleniumRC test in Xephyr window

Xephyr is an X windowing system whose display lives entirely within…a window in another X server! See the Xephyr site for more.