【发布时间】:2017-01-27 09:47:49
【问题描述】:
我在启动 firefox 驱动程序时包含了 firebug,它在最新的 selenium web driver 3.0 上运行良好,但同时每次启动浏览器时它也会打开新的 firebug 选项卡。
正如代码所说,我已经包含了 firebug 文件并在创建的配置文件中添加了这个扩展。有什么方法可以在启动浏览器后自动关闭 firebug 选项卡?如果没有自动方法,那么我需要使用调整来关闭名为“Firebug”的窗口,对吗?
代码:
File file = new File("./firebug-2.0.17-fx.xpi");
System.setProperty("webdriver.gecko.driver", config.getStringProperty("geckodriver.path"));
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(file);
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
capabilities.setCapability("marionette", true);
webDriver = new FirefoxDriver(capabilities);
【问题讨论】:
-
我已经在初始评论中添加了我正在寻找自动解决方案,但无论如何只需要通过打开的窗口处理:) 发布答案...
标签: selenium selenium-webdriver selenium-firefoxdriver