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
- Open Firefox Browser
- Click hamburger menu
- Click Help
- Click about Firefox
Extra #2:
Versions of Selenium.Webdriver & Selenium.Support (3.)
Related Topics
Raising a Number to a Power in Java
Reserved Words as Names or Identifiers
Problem with Assigning an Array to Other Array in Java
Making Distinctions Between Different Kinds of Jsf Managed-Beans
Increasing Heap Space in Eclipse: (Java.Lang.Outofmemoryerror)
How to Get a Value from the Last Inserted Row
(Unknown Source) in Exception Stack Trace
Java.Lang.Outofmemoryerror: Permgen Space
Directly Convert CSV File to JSON File Using the Jackson Library
Javafx Using Objects from Maincontroller or Other Controllers in Proper Controller Class
Java.Util.Concurrentmodificationexception Not Thrown When Expected
How to Change Font Size in Eclipse for Java Text Editors
How to Call a Method in Another Class of the Same Package
Gson Custom Seralizer for One Variable (Of Many) in an Object Using Typeadapter