Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从代码中以静默模式启动 Firefox(无需通过删除 -b 参数运行脚本)?
或者是否有任何其他方法可以最小化 Firefox,以便在多个浏览器窗口同时打开时测试可以正常运行而不会打扰用户?
如果您在 Linux 上:
require 'watir-webdriver' require 'headless' headless = Headless.new headless.start b = Watir::Browser.start 'www.google.com' puts b.title b.close headless.destroy
您必须安装 Xvfb。
更多信息:http ://watirwebdriver.com/headless/