Suman Verma
Suman Verma

Reputation: 55

unable to launch URL in Firefox

I am unable to launch URL in Firefox. The browser is successfully launched but the URL that it open is :"https://www.mozilla.org/en-US/firefox/43.0.4/firstrun/learnmore/". And this browser closes itself after sometime.

This might be an issue with profile setting, but unsure how to fix this issue.

Code used:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Launchingbrowsers {

    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.get("https://www.facebook.com/?_rdr=p");
    }
}

Please help with steps to resolve this issue

Upvotes: 2

Views: 8236

Answers (4)

Sarabjit Singh
Sarabjit Singh

Reputation: 790

There are two possible solutions.

  1. You need to disable the first run page of Firefox to make it working. This you can be achieved by setting preferences

    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 you will not face this issue :)

  1. If Solution in point 1 doesn't help, then upgrade Selenium WebDriver will solve the issue.

Hope this helps :)

Upvotes: 0

Shubham Jain
Shubham Jain

Reputation: 17553

I think that's happening because the new issue occurs with latest update of Mozilla firefox.

It was happened with me too.

To overcome from this issue you need to setPreference as xpinstall.signatures.required", false to firefox Profile and then pass it to driver object

firefoxProfile.setPreference("xpinstall.signatures.required", false);

Below code is working fine for me.

static WebDriver driver=null;
public static void main(String[] args) {
    final FirefoxProfile firefoxProfile = new FirefoxProfile();
    firefoxProfile.setPreference("xpinstall.signatures.required", false);
    driver = new FirefoxDriver(firefoxProfile);
    driver.get("https://www.google.de/");

Hope it will help you :)

Upvotes: 3

Buaban
Buaban

Reputation: 5137

I assume that your test is timeout because Firefox cannot load profile, so it can launch the browser but cannot navigate to your web. You have to downgrade Firefox, or upgrade Selenium, or downgrade both Firefox and Selenium.

Upvotes: 0

Andrew Regan
Andrew Regan

Reputation: 5113

This may help you eliminate the Firefox "first run" page:

Firefox webdriver opens first run page all the time

Both of the top two answers (perhaps prefer https://stackoverflow.com/a/33939553/954442) suggest very plausible-looking FirefoxProfile configuration to eliminate the problem.

Upvotes: 0

Related Questions