开发者

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

开发者 https://www.devze.com 2023-02-28 04:12 出处:网络
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

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

精彩评论

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