【发布时间】:2016-03-05 09:13:02
【问题描述】:
我在 Firefox 浏览器上运行了一些 selenium 测试。
不幸的是,虽然我很小心地创建了一个新的配置文件,但当我开始测试时,我总是会显示 Firefox 的 /firstrun/ 页面,这很烦人,因为该页面会通过网络获取内容。
我已尝试通过以下方式禁用它
FirefoxProfile profile = new FirefoxProfile(profileDir);
if(!exists) {
profile.setPreference("signed.applets.codebase_principal_support", true);
profile.setPreference("capability.principal.codebase.p0.granted", true);
profile.setPreference("startup.homepage_override_url", "about:blank");
profile.setPreference("browser.startup.homepage_override.mstone", "'ignore'");
但它仍然出现。
如何确保 Firefox 启动时不显示页面?
【问题讨论】:
-
为什么
ignore值用单引号括起来?我认为不应该。
标签: java firefox selenium junit