How to run selenium server sessions on different xvfb screens?
Asked Answered
F

2

10

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.

Faso answered 21/8, 2013 at 11:6 Comment(1)
Wow, what you are trying to do is really interesting. Do you mind sharing a HOWTO (perhaps on a blog somewhere) after you figure it all out? I think a lot of Selenium people might be interested in how to do this kind of thing.Pasqualepasqueflower
M
1

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"&
Muro answered 18/2, 2014 at 4:30 Comment(2)
That won't work unless you pass the port number option. Otherwise, 2 or more services cannot listen on the same port 4444.Pasqualepasqueflower
the hub is on 4444 but I take your point about the client on its default port. the port can be specified with the -port option for the node. I updated the exampleMuro
A
1

For this kind of use, you could typically use the xvfb-run command (which can select automatically a display, but it can be configured)

Then you can create a firefox start script that would do xvfb-run firefox that you could use as the selenium firefox start command (specified as a FirefoxBinary)

Acclimatize answered 19/2, 2014 at 9:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.