I\'m seeing a bizarre \"untrusted cert\" error only on selenium-controlled firefox pop-ups. Very specific. To solve this problem, various google results suggested turning of
You have take care of a couple of things as follows:
"untrusted cert" error only on selenium-controlled firefox pop-ups
: This is a common issue and we can avoid that through configuring the WebDriver
instance through DesiredCapabilities
class.turning off marionette
: Turning off marionette
is no more a solution while we work with Selenium 3.x and recent Mozilla Firefox Browser releases. By forcefully setting "marionette" to false through DesiredCapabilities class you won't be able to open Mozilla Firefox Browser above version 48.x.DesiredCapabilities
class but still works and open a Mozilla Firefox Browser session of legacy releases which is also installed on your machine which is below version 48.xhttps://www.whatismybrowser.com/
.Code:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = False
driver = webdriver.Firefox()
driver.get('https://www.whatismybrowser.com/')
Result: Mozilla Firefox version 47 is opened.
executable_path
while initializing the driver.It is to be noted that the current Selenium-Python binding is unstable with geckodriver and looks to be Architecture specific. You can find the github discussion and merge here. So you may additionally need to pass the absolute path of the firefox binary as
firefox_binary
argument while initializing the webdriver
Code:
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
binary = FirefoxBinary('C:\\Program Files\\Mozilla Firefox\\firefox.exe')
firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
driver = webdriver.Firefox(firefox_binary=binary,executable_path='C:\\Utility\\BrowserDrivers\\geckodriver.exe')
driver.get('https://www.whatismybrowser.com/')
Result: Mozilla Firefox version 53 is opened.