Reputation: 42434
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
Reputation: 22710
You can do
System.setProperty("webdriver.firefox.bin","PATH_TO_BINARY");
Upvotes: 0
Reputation: 14738
PATH
firefox.exe
somewhereIt 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