Firefox webdriver 一直打开首次运行页面 [英] Firefox webdriver opens first run page all the time

查看:29
本文介绍了Firefox webdriver 一直打开首次运行页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为 FF 一劳永逸地禁用这个首次运行"页面?

创建 FF 驱动程序时,它会打开带有 - 的选项卡

在带有 Selenium 2.48 的 C# 中,我找到了以下解决方案:

FirefoxProfile prof = new FirefoxProfile();prof.SetPreference("browser.startup.homepage_override.mstone", "忽略");prof.SetPreference("startup.homepage_welcome_url.additional", "about:blank");Driver = new FirefoxDriver(prof);

...它再也不会打扰你了.

注意:单独使用这些设置之一也可以.我将它们一起使用以使其防弹.

How to disable this "first run" page once and for all for FF?

When FF driver is created, it opens tab with - https://www.mozilla.org/en-US/firefox/42.0/firstrun/learnmore/ and additional tab with target page.

解决方案

To turn off this annoying start page:

in C# with Selenium 2.48 I found the following solution:

FirefoxProfile prof = new FirefoxProfile();
prof.SetPreference("browser.startup.homepage_override.mstone", "ignore");
prof.SetPreference("startup.homepage_welcome_url.additional",  "about:blank");
Driver = new FirefoxDriver(prof);

...and it will never bother you again.

Note: One of these settings alone will also work. I use them together to make it bullet-proof.

这篇关于Firefox webdriver 一直打开首次运行页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆