coure2011
coure2011

Reputation: 42434

cannot find firefox binary in path

I am getting error:

Failed: org.openqa.selenium.WebDriverException Cannot find firefox binary in PATH, make sure firefox is installed. OS appears to be WIN8

I am using Selenium v 2.30 and Firefox v.19 on windows 8 64bit

same code was working perfectly on windows7/SP1.

if(browser == SupportedBrowser.FIREFOX) {           
           //firefox driver is built into selenium standalone server
           return new FirefoxDriver();
       }

Upvotes: 1

Views: 6547

Answers (2)

Ajinkya
Ajinkya

Reputation: 22710

You can do

System.setProperty("webdriver.firefox.bin","PATH_TO_BINARY");

Upvotes: 0

Pavel Janicek
Pavel Janicek

Reputation: 14738

  1. Open Command line (Start -> Run -> type "cmd")
  2. type PATH
  3. Verify that you can see here written firefox.exe somewhere

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

if(browser == SupportedBrowser.FIREFOX) { 
  File pathToBinary = new File("path/to/firefox.exe");
  FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
  FirefoxProfile firefoxProfile = new FirefoxProfile();
  FirefoxDriver _driver = new FirefoxDriver(ffBinary,firefoxProfile);
  return _driver;
}

Upvotes: 3

Related Questions