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

前端 未结 14 1279
眼角桃花
眼角桃花 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 13:52

    I was also facing the same problem and I spent more than a week to fix it. Restarting my machine seemed to have fixed it, but only temporarily.

    There was a solution to increase the maximum number of ephemeral ports by editing the registry file. That seemed to have fixed the problem but that also, only temporarily.

    For sometime, I kept thinking if I was trying to access a driver which is no longer available, so I have tried to call:

    driver.quit()
    

    And then recreate the browser instance, which only gave me: SessionNotFoundException.

    I now realized that I had used BOTH System.setProperty as well as ffCapability.setCapability to set the path of the binary.

    I then tried with only System.setProperty => No luck there.

    Only ffCapability.setCapability => Voila!!! So far it has been working fine. Hopefully it will work great when I try to re-run my scripts tomorrow and the day after and the day after... :)

    Bottomline: Use only this

    ffCapability.setCapability("binary", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); //for windows`
    

    Hope it helps!

提交回复
热议问题