Java 使用Selenium时如何绕过firefox更新页面?

Java 使用Selenium时如何绕过firefox更新页面?,java,firefox,selenium,junit,Java,Firefox,Selenium,Junit,我在Firefox浏览器上运行了一些selenium测试。 不幸的是,尽管我注意创建了一个新的配置文件,但我总是在测试开始时显示Firefox的/firstrun/页面,这很烦人,因为该页面通过web获取内容 我试着用下面的方法禁用它 FirefoxProfile profile = new FirefoxProfile(profileDir); if(!exists) { profile.setPreference("signed.applets.codebas

我在Firefox浏览器上运行了一些selenium测试。 不幸的是,尽管我注意创建了一个新的配置文件,但我总是在测试开始时显示Firefox的
/firstrun/
页面,这很烦人,因为该页面通过web获取内容

我试着用下面的方法禁用它

    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启动时不显示页面?

Kiril提出了一个正确的问题——“为什么使用单引号?”。没有它对我来说很有用

 profile.setPreference("browser.startup.homepage_override.mstone", "ignore");

另一种方法是在创建Firefox实例之后加载空白页(驱动程序.GET(“关于:空白”);)< /P>为什么单引号中的<代码>忽略< /代码>值?我想不应该。