Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA

前端 未结 14 1119
眼角桃花
眼角桃花 2020-12-25 13:10

I am not able to run my script in any of the browsers. Below is the error i get for firefox. The location where firefox is installed is correct. Dont know what is wrong.

相关标签:
14条回答
  • 2020-12-25 14:03

    For some reason, adding the environment variable didn't work for me.

    I was able to specify a path to Firefox in the command line node configuration, as described on this page (grid2).

    -browser “browserName=firefox,version=3.6,firefox_binary=c:\Program Files\Mozilla Firefox\firefox.exe ,maxInstances=3, platform=WINDOWS”
    
    0 讨论(0)
  • 2020-12-25 14:04

    I had this problem when moving my project from one computer to another. The solution was to reload selenium webdriver from nuget.

    0 讨论(0)
  • 2020-12-25 14:07

    It seems that Firefox gets installed in the App data folder Path C:\Users\users\AppData\Local\Mozilla Firefox

    So you can set the firefox bin property as below

    System.setProperty("webdriver.firefox.bin", "C:\\Users\\*USERNAME*\\AppData\\Local\\Mozilla Firefox\\Firefox.exe");
    

    Adding this resolved the issue for me

    0 讨论(0)
  • 2020-12-25 14:08
    1. Open Command line (Start -> Run -> type "cmd")
    2. type PATH
    3. Verify that you can see here written C:\Program Files\Mozilla Firefox15\Firefox.exe

    It will be probably not here - because thats what the error says. How to fix it?

    1. Click Start
    2. Right click on "Computer" and click "Properties"
    3. In left menu Choose "Advanced system settings"
    4. Go to tab "Advanced" and click "Environment Variables..."
    5. In the window below select "Path" and click "Edit..." (Admin rights needed)
    6. Add at the end the desired path, semicolon separated
    7. Possible restart of computer needed

    It his does not help then change the constructor like this:

    File pathToBinary = new File("C:\\Program Files\\Mozilla Firefox15\\Firefox.exe");
    FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
    FirefoxProfile firefoxProfile = new FirefoxProfile();
    FirefoxDriver _driver = new FirefoxDriver(ffBinary,firefoxProfile);
    
    0 讨论(0)
  • 2020-12-25 14:10

    I got this error message while running tests in Visual Studio: Firefox simply wouldn't load and I got OP's error message.

    I manually opened Firefox and found out that it needed to update itself (it did so before loading). Once finished I reran the test suite and Firefox showed up nicely, the tests were properly ran. If you get this error all of a sudden please try this answer before updating anything on your machine.

    0 讨论(0)
  • 2020-12-25 14:12

    I was also suffering from the same issue. Finally I resolved it by setting binary value in capabilites as shown below. At run time it uses this value so it is must to set.

    DesiredCapabilities capability = DesiredCapabilities.firefox();
    capability.setCapability("platform", Platform.ANY);
    capability.setCapability("binary", "/ms/dist/fsf/PROJ/firefox/16.0.0/bin/firefox"); //for linux
    
    //capability.setCapability("binary", "C:\\Program Files\\Mozilla  Firefox\\msfirefox.exe"); //for windows                
    WebDriver    currentDriver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
    

    And you are done!!! Happy coding :)

    0 讨论(0)
提交回复
热议问题