Quaatso Education

Home Forums Selenium Forum Not able to open any page in firefox browser

Not able to open any page in firefox browser

This topic contains 5 replies, has 2 voices, and was last updated by  Nandan Singh 1 year, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4002

    Shobhna Garg
    Participant

    Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases

    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)

    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)

    at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:38)

    at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:91)

    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)

    at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:244)

    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:219)

    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:214)

    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:210)

    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:123)

    at InvokeBrowser.main(InvokeBrowser.java:8)

     

    #4003

    Nandan Singh
    Keymaster

    Shobhna, in this problem, Webdriver is not able to find default Firefox executable file. This can be solved by providing default profile of your Firefox Driver.

    For providing default profile use following step :

    1. Enter following string in windows run : %APPDATA%\Mozilla\Firefox\Profiles\

    2. It will open folder where your default profile of Firefox is saved.

    3. Open default profile folder and copy entire path. It will be like “C:\Users\home\AppData\Roaming\Mozilla\Firefox\Profiles\9xj5wht8.default”

    4. Now create Firefox profile in your script and invoke firefox. This will be looked like:

    File path = new File(“C:\\Users\\home\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\9xj5wht8.default”);

    FirefoxProfile profile = new FirefoxProfile(path);

    FirefoxDriver driver = new FirefoxDriver(profile);

    driver.get(“https://www.facebook.com/”);

    Hope this will resolve your problem.

    #4004

    Shobhna Garg
    Participant

    Still facing the same issue My script is as follows:

    import java.io.File;

     

    import org.openqa.selenium.firefox.FirefoxDriver;

    import org.openqa.selenium.firefox.FirefoxProfile;

     

     

     

    public class InvokeBrowser {

     

    public static void main(String[] args) {

     

    File path = new File(“C:\\Users\\shobhna\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\8ogf6qo3.default”);

     

    FirefoxProfile profile = new FirefoxProfile(path);

     

     

    FirefoxDriver driver = new FirefoxDriver(profile);

     

    driver.get(“https://www.facebook.com”);

     

    }

     

    }

     

    #4005

    Nandan Singh
    Keymaster

    From your exception, it seems you are using Mozilla’s Gecko engine ( I don’t know how !!!). For this first you need to Marionette, which is nothing but the automation driver for Gecko engine.

    Please try following steps for using this :

    1. Download Marionette Driver from following link  :

    https://github.com/mozilla/geckodriver/releases

    2. Save above file at some location and unzip same.

    3. Now copy the path till the marionette executable file and use following code :

    File path = new File(“E:\\driver\\geckodriver.exe”); // this is the path till executable file

    System.setProperty(“webdriver.gecko.driver”, path.getAbsolutePath());

    WebDriver driver = new MarionetteDriver();

    driver.get(“https://www.facebook.com/”);

    To learn about Marionette please refer following link :

    https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver

    Hope this will solve your problem.

    #4006

    Shobhna Garg
    Participant

    It works but still some message “1469894001850 Marionette INFO Listening on port 52247” appears

    #4009

    Nandan Singh
    Keymaster

    Good to hear, it is working.

    And all these messages are nothing but the “logs” generated during starting of server.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.