Tuesday, December 2, 2014

FireFox browser path configuration - "cannot find firefox binary in path."

 "Cannot find firefox binary in path." This error occurs if WebDriver cannot locate firefox in its default PATH i,e (C:/Program Files/Mozilla/). This could be possibly due to installing firefox in a folder other than the default folder.


Error: Exception in thread "main" org.openqa.selenium.WebDriverException: 
Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15' System info: host: 'INB-W0223', ip: '10.57.42.105', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67' Driver info: driver.version: Driver at org.openqa.selenium.firefox.internal.Executable.(Executable.java:72) at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:59) at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:55) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:103) at Driver.main(Driver.java:19)

This can be resolved by using the webdriver.firefox.bin system property.

Code:
System.setProperty("webdriver.firefox.bin","C:/path to firefox installed folder/firefox.exe");

No comments:

Post a Comment