Selenium 3.0.2 error with Firefox 50: executable may have wrong permissions

时光毁灭记忆、已成空白 提交于 2020-01-06 19:51:23

问题


I'm trying to use Selenium 3.0.2 with Firefox 50.0.1 in Windows 7. I've followed the instructions in this post to setup correctly the driver and the paths but I'm getting the following error:

Traceback (most recent call last):
  File "ixps-bgp.he.net.py", line 38, in <module>
    browser = webdriver.Firefox(firefox_binary=binary,capabilities=caps, executable_path='<path to gecko driver>')
  File "C:\Users\<myusername>\AppData\Local\Continuum\Anaconda2\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 140, in __init__
    self.service.start()
  File "C:\Users\<myusername>\AppData\Local\Continuum\Anaconda2\lib\site-packages\selenium\webdriver\common\service.py", line 86, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: '' executable may have wrong permissions.

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00000000023BA240>> ignored

Even when I try to execute the script as administrator I still get the error above. I'm using the latest version of the gecko driver (0.13) and I tried both the 64-bit and 32-bit versions. Is this a known issue with any of the current versions?


回答1:


You should use entire exe address. If you pass just the folder you'll have problems.

>>>chromepath = "C:\\Dev\\chromedriver.exe"
>>>driver = webdriver.Chrome(chromepath)


来源:https://stackoverflow.com/questions/41919932/selenium-3-0-2-error-with-firefox-50-executable-may-have-wrong-permissions

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