开发者

How do you make SeleniumRC open Firefox windows without focusing them?

Whenever I run a SeleniumRC script (using Ruby's selenium-client), the Firefox instance opens in front of al开发者_如何学Gol my other windows. This is a bit annoying. Is there a way to make it run behind my focused window?


If you are on Linux you can use XVFB and then tell Selenium to use the new virtual display.

More details can be found here but essentially its

  1. startx -- which Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
  2. DISPLAY=:1 java -jar selenium-server.jar


If you are on windows you can use the desktops tool which provides you with multiple desktops which you can switch between. With that tool installed you can start RC on a different desktop and firefox won't be launched on your primary desktop anymore.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜