Riduidel
Riduidel

Reputation: 22300

How to bypass the firefox update page when using Selenium?

I have some selenium tests running on Firefox browser. unfortunatly, although I take care to create a new profile, I always have the /firstrun/ page of Firefox showing up when my test start, which is rather annoying, since that page gets it content over the web.

I've tried disabling it the following way

    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'");

but it stills shows up.

What can I do to make sure Firefox starts with no page shown ?

Upvotes: 5

Views: 189

Answers (1)

Hubert
Hubert

Reputation: 446

Kiril asks the right question - "Why the single quotes?". Without it works for me.

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

An alternative approach is to load the blank page after the Firefox instance has been created (driver.get("about:blank");)

Upvotes: 1

Related Questions