Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA

前端 未结 14 1116
眼角桃花
眼角桃花 2020-12-25 13:10

I am not able to run my script in any of the browsers. Below is the error i get for firefox. The location where firefox is installed is correct. Dont know what is wrong.

14条回答
  •  囚心锁ツ
    2020-12-25 14:12

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

提交回复
热议问题