views:

26

answers:

1

I am running a multiserver Selenium testing environment using headless VPSs. I have nearly everything automated except for a specific need to declare the DISPLAY=:1 argument when starting Selenium within a screen session (due to running VNC server). Here is the command I'd like to work:

screen -d -m DISPLAY=:1 java -jar /root/Desktop/selenium-server-1.0.3/selenium-server.jar

I want this to fire at startup to have Selenium running, and then immediately detach from screen. This works fine without the DISPLAY argument, but ignores the DISPLAY argument in the above command.

Any suggestions?

A: 

Under a similar situation, I ended up on saucelabs.com service, which does the provisioning thing for you. I really like its service.

But, lets get to the point: It seems screen doesn't inherit the parent shell, but there are two alternatives:

  • First, wrap the display into a shell script
  • Second, use the .screenrc setenv, like this example: setenv DISPLAY :1

Hope that helps.

aldrinleal