Selenium.common.exceptions.webdriverexception: Message: 'mozilla Firefox' Executable May Have Wrong Permissions While Using Geckodriver
I've had some trouble trying to get selenium to do stuff with browsers. I'm a super-beginner at this type of stuff, but I still searched, and the most pertinent response I found w
Solution 1:
This error message...
selenium.common.exceptions.WebDriverException: Message: 'Mozilla Firefox' executable may have wrong permissions.
...implies that the Mozilla Firefox executable was unaccessable due to wrong permissions.
While working with Selenium v3.x, GeckoDriver and Firefox you have to consider certain facts as follows:
- Instead of Mozilla Firefox binary (i.e.
firefox.exe
) you need to pass the absolute path of the GeckoDriver binary through the argumentexecutable_path
within single quotes (i.e.''
) along with the raw (r
) switch. - You need to download the latest release of GeckoDriver from this link and ensure that GeckoDriver have required permissions to be accessed by non-root user.
- Always execute your TestCases/TestSuite as a non-root user.
Your effective code block will be as follows:
from selenium import webdriver driver = webdriver.Firefox(executable_path=r'C:\path\to\geckodriver.exe')
Solution 2:
I believe that for Firefox version (47.0 +) you need to use geckodriver. Check it out here: https://github.com/mozilla/geckodriver/releases
Post a Comment for "Selenium.common.exceptions.webdriverexception: Message: 'mozilla Firefox' Executable May Have Wrong Permissions While Using Geckodriver"