views:

28

answers:

3

Hello,

I'd like not to be disturbed by the browser that is launched by Selenium RC. Is there any way how to force it to run the browser on another X11 desktop? Running Selenuim server on another desktop does not solve the problem.

Vít Šesták 'v6ak'

+3  A: 

Yes, on Linux you can start for example Xvfb (X in a virtual framebuffer) to provide an X environment and launch the selenium controlled browser in that.

We are doing that for years on headless server boxes and that work just fine (well from time to time you have to shoot a hanging browser, but that is the same on a desktop).

Here are more details to do this with maven.

Peter Tillemans
Thank you. It seems to be good. However, I'd prefer to run in another desktop, not in virtual screen. It is sometimes useful to watch the progress and maybe analyse the problem.
v6ak
You can use Xvncserver instead. We found it to be not reliable enough. You can run a lightweight desktop like xfce and let it start a vncserver and selenium rc
Peter Tillemans
+1  A: 

You should be able to do this by setting the DISPLAY environment variable to a different display than the one your desktop is using. This must be set when starting up the Selenium server. Selenium will then use this value when starting up the browsers.

nirvdrum
Thank you, but you probably didn't understand me well. I've one display and four desktops. I can switch them by Win+F1/F2/F3/F4. $DISPLAY does not seem to be able to affect the desktop which the app is opened on.I've discovered that OpenBox (WM that I use) can set a specific desktop for specified windows. Window is identified by Name/Class/Role/type (eg. main/psi//normal). But I don't know how to make the Selenium Firefox windows specific.
v6ak
No worries. I understood, but adding another display would likely be the simplest thing for you. I doubt you're going to find too many people trying to achieve what you are.
nirvdrum
Hmm, but I'm not sure that I can map a display to a desktop.
v6ak
Well, it is not a bad idea at all. At first, I've to run a new session:$ xinit /usr/bin/openbox-session -- :1So, I've two sessions and I can switch them by Ctrl+Alt+F7 and Ctrl+Alt+F8. I can see that these session have different $DISPLAY. So, I can use this solution now. It is probably better than the other.
v6ak