开发者

Is it possible to let capybara/webdriver start firefox minimized/unfocused?

开发者 https://www.devze.com 2023-02-20 07:51 出处:网络
Is it possible to stop Firefox from popping up when cucumber hits a @javascript tag? After a while it gets frust开发者_开发百科rating to always get disrupted while running tests.

Is it possible to stop Firefox from popping up when cucumber hits a @javascript tag? After a while it gets frust开发者_开发百科rating to always get disrupted while running tests.

It would be nice if webdriver was to start Firefox minimized or not focus on it.


There's no API in WebDriver to do this, and it's not really advisable since Firefox won't trigger certain events (like focus, blur) when the window is in the background. I usually work around this by using a virtual machine (e.g. in VirtualBox) or a separate X display.


You can add lines below to Info.plist of Firefox.app. After that it will start without grabbing focus.

<key>LSBackgroundOnly</key>
<string>1</string>
0

精彩评论

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