Cannot Find Firefox Binary in Path. Make Sure Firefox Is Installed

Firefox is showing Cannot find firefox binary in PATH. error in MAC OS

According to https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver there is a property you have to set to set the binary path:

webdriver.firefox.bin

so i assume you have to do following:

    System.setProperty("webdriver.firefox.bin","/Applications/Firefox.app/Contents/MacOS/firefox-bin");
WebDriver driver = new FirefoxDriver();

I hope this helps :)

OpenQA.Selenium.WebDriverException: Cannot find Firefox binary in PATH or default install locations (Visual Studio 2017, C#)

Created this question specifically to answer the question. I never found the answer anywhere and the solutions I did see weren’t addressing the baseline issue.

The main reason you will get this error message is Not because you don’t have Firefox in your PATH. Firefox DOES need to be in your PATH environment variables. However, when you install Firefox, the install will add itself (Firefox) to your PATH environment variables automatically.

The main reason you get this error when working with Selenium is because the NuGet package you installed for your Selenium project (Visual Studio 2017, C#) does not mesh with the version of Firefox you actually have installed on your computer.

After determining the issue, I was able to find an article about the incompatibility.
https://www.guru99.com/gecko-marionette-driver-selenium.html

“Selenium Webdriver version 2.53 is not compatible with Mozilla
Firefox version 47.0+. The Firefox driver used in earlier versions of
Mozilla Firefox will be discontinued, and only the GeckoDriver
implementation would be used.”

Apparently there is a new NuGet called GeckoDriver which we should use instead of the Firefox driver which comes with Selenium. Eventually, that will be the only option.
BUT for now, if you up date your Selenium.WebDriver to the latest (at least 3.xxx … 3.1, 3.2 …), it should run nicely.

Right now I have Firefox browser version 66.0.5 installed on my computer and that seems to work with any 3.xxx version of Selenium.WebDriver. I currently have Selenium.WebDriver 3.141.0 installed and those two versions work nicely together.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Extra #1:
how to check your version of firefox

  1. Open Firefox Browser
  2. Click hamburger menu
  3. Click Help
  4. Click about Firefox
    Sample Image

Extra #2:
Versions of Selenium.Webdriver & Selenium.Support (3.)
Sample Image



Related Topics



Leave a reply



Submit