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

寵の児 提交于 2019-12-03 15:33:50

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.

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

Add the whole path including name of the exe file as shown below to the path.

C:\Program Files (x86)\Firefox ESR 17\firefox.exe

I too had same problem but somehow I've resolved this issue by,

  1. updating my JAR Files: selenium-java-2.43.0.jar to selenium-java-2.48.2.jar and selenium-server-standalone-2.43.1.jar to selenium-server-standalone-2.48.2.jar
  2. Added a new JAR file selenium-java-2.48.2-srcs.jar to lib

These changes made my code flawless in my case

In selenium, if you are using chrome driver, then org. openqa. Selenium. WebDriverException mainly shows when the chrome releases a new chrome driver. So try to use the latest chrome driver, and check whether the issue is solved.

Vikrantsinh Karande

Just specify the path by doing:

System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");

This will solve the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!