Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH running tests in Selenium IDE with Webdriver playback

I keep on getting the following errors when I attempt to run tests in Selenium IDE with Webdriver playback.

Caused by: org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA
Build info: version: ’2.32.0′, revision: ’6c40c18′, time: ’2013-04-09 17:22:56′
System info: os.name: ‘Windows 7′, os.arch: ‘amd64′, os.version: ’6.1′, java.version: ’1.6.0_39′
Driver info: driver.version: FirefoxDriver
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.getBinary(FirefoxDriver.java:175)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:100)
… 14 more

The error mentions not finding the firefox binary in PATH. I updated the Firefox binary in the path and I still receive the same error message. The functions used in the test case were one custom case and waitforelementpresent.

This is the variable value that I have in my path C:\Program Files (x86)\Firefox ESR 17

How can I resolve this?

like image 216
user2320600 Avatar asked Apr 25 '13 16:04

user2320600


2 Answers

i updated the enviroment variable path but it didn't work for me. Don't add firefox.exe in the end e.g. E:\installed\Firefox Mozilla. And restart the eclipse. It worked for me.

like image 120
learner Avatar answered Sep 28 '22 14:09

learner


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 :)

like image 42
Santosh Ganacharya Avatar answered Sep 28 '22 16:09

Santosh Ganacharya