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.
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”
I had this problem when moving my project from one computer to another. The solution was to reload selenium webdriver from nuget.
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
PATH
C:\Program Files\Mozilla Firefox15\Firefox.exe
It will be probably not here - because thats what the error says. How to fix it?
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);
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.
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 :)