Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run selenium server sessions on different xvfb screens?

My problem is how to get an isolated video streams from SeleniumServer browser instances. Let me explain.

I have Selenium Server hub running at Ubuntu Server machine and the Selenium Server node running at the same server so I use the 'headless' Selenium mode using xvfb. I run the nodes like this: DISPLAY=:99 java -jar selenium-server-standalone.jar -role node -hub http://localhost:4444/grid/register

Then I wanna get video streams of the tests running there so I installed the x11server connected to the xvfb virtual display and after that I can to connect those remote server using VNC and I see my tests processing. The trouble is that all browser instances inside the node rendered at the same virtual display (#99) and when I need running several tests at the same time, I see many browser instances overlaying one by one. But I wanna record the error tests video streams so I can't do this. So I need to have probability to connect to every browser virtual display apart.

I think I can solve this problem by tuning the xvfb server somehow to force it to create isolated virtual display or screen (xvfb has multiscreen support, hasn't it?) for every client (browser instance in my case). But I have tried to do this and I have not get a result. Also I can use another virtual display (not xvfb) if it's necessary to solve this.

Please, help me to get isolated video streams from every browser instance :) Thanks a lot and sorry about my English.

like image 335
skavans Avatar asked Aug 21 '13 11:08

skavans


People also ask

What is XVFB screen?

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

With the selenium hub, you can add the browsers in separately in their own Xvfb sessions

java -jar selenium-server-standalone-2.33.0.jar -role hub& 

then connect each browser separately in its own Xvfb session, DISPLAY and port

export DISPLAY=:11
Xvfb :11 -screen 0 1024x768x16 &

java -jar selenium-server-standalone-2.33.0.jar \
   -role node \
   -port 4441
   -hub http://localhost:4444/grid/register \
   -browser "browserName=firefox,version=19,maxInstances=5"&
like image 158
KeepCalmAndCarryOn Avatar answered Sep 27 '22 15:09

KeepCalmAndCarryOn