selenium: selenium.common.exceptions.WebDriverException: Message: Can't load the profile.

Meta -

OS: Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux Selenium Version: 2.53.6 Browser: Firefox ESR Browser Version: 45.3.0(64-bit) Python Version: 3.4.2

Expected Behavior -

  1. Open the browser
  2. and open the url (https://www.baidu.com)

Actual Behavior -

  1. Open the browser
  2. quit the browser
  3. output the error message to the terminal
(py342) woohoodai@Oycir:~/workspace/superlists$ python functional_test.py 
Traceback (most recent call last):
  File "functional_test.py", line 3, in <module>
    driver = webdriver.Firefox()
  File "/home/woohoodai/.pyenv/versions/py342/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
    self.binary, timeout)
  File "/home/woohoodai/.pyenv/versions/py342/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "/home/woohoodai/.pyenv/versions/py342/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "/home/woohoodai/.pyenv/versions/py342/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 108, in _wait_until_connectable
    % (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmpmtam_wio If you specified a log_file in the FirefoxBinary constructor, check it for details.

Steps to reproduce -

  1. Run the script
from selenium import webdriver

driver = webdriver.Firefox()

driver.get('https://www.baidu.com')

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 30 (2 by maintainers)

Commits related to this issue

Most upvoted comments

this worked for me:

wget https://github.com/mozilla/geckodriver/releases/download/v0.10.0/geckodriver-v0.10.0-linux64.tar.gz
tar xzvf geckodriver-v0.10.0-linux64.tar.gz
cp geckodriver /usr/bin/
pip install selenium==3.0.0b3

Every case here appears to be that where everyone is attempting to use Firefox 48 (or greater) with the ‘old’ FirefoxDriver implementation.

If you are using Firefox 48+ you need to use GeckoDriver: https://github.com/mozilla/geckodriver

The old FirefoxDriver by the selenium project no longer works due to extension signing and mozilla’s refusal to sign it. But even if they did sign it, or one used an ‘unbranded’ build of firefox, the extension will likely stop working soon due to other changes to Firefox.

Which is why in 3.0 beta releases (they are marked as beta in pypi, why a pip install -U will not pick it up), webdriver.Firefox will default to using Mozilla’s geckodriver. Similar to chromedriver / IEDriverServer / EdgeDriver / phantomjs. It is a separate binary on your system that you need to download and put on your system path.

There are quite a few issues with using Firefox 48 and GeckoDriver, that are fixed in FirefoxNightly. I would recommend attempting to see how well your test suite does with FirefoxNightly when trying to switch to GeckoDriver.

To continue to use the old FirefoxDriver on FF 47.0.1 or earlier versions (excluding 47.0 ~ which doesn’t work with selenium), you should be setting the DesiredCapability “marionette”: False:

driver = webdriver.Firefox(capabilities={"marionette":False})

If you believe you are receiving this error other than a version mismatch with Firefox and the driver implementation issue, then please log a new issue.

I’ve adjusted the error message in 649b1185da3ddb43c63c3b3be3bd482a56c14c8a but I fear that will not do enough to help users.

I confirm the bug on Ubuntu 16.04, Python 3.5, Selenium2.53.6, Firefox 48 and 49. Thanks to @BroncaDonk, I get it working :

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium import webdriver
binary = FirefoxBinary('/path/to/firefox46.0.1') # from https://ftp.mozilla.org/pub/firefox/releases/46.0.1/
d = webdriver.Firefox(firefox_binary=binary)

Same problem with Selenium 2.53.6, Python 3.4.3 (64bit), Windows7 (64bit), and Firefox 47.0 or 48.0.2.

Rolling back Firefox to 46.0.1 functions as a workaround for me.

Emptying C:\Users\myprofile\AppData\Local\Temp did not fix. Issuing “pip install -U selenium” did not fix

@nim4 workaround works, but you need to understand that a combination of Firefox/Geckodriver/Selenium is required to make it work. The question is: how do you know which combination is the correct one? Unfortunately, you need a trial and error approach. I’m stuck with Firefox 52.6.0 ESR, so the little tutorial here for discovering the compatible versions is for this situation.

I started with geckodriver changelogs to extract this combination. They have a changelog but it’s not in all releases that they give an insight of which versions of FIrefox/selenium are compatible or not. Since I’m stuck in Firefox 52.6.0 ESR, I searched for “Firefox 53” in their full changelog. In version v0.18.0, there’s geckodriver now recommends Firefox 53 and greater so I downloaded v0.17.0 directly into my /usr/bin folder:

sudo wget -c https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz -O - | sudo tar -xz -C /usr/local/bin/

Since they don’t tell which Selenium version is compatible with gecko 0.17.0, I kept reading the changelog until I found Note that geckodriver v0.16.0 is only compatible with Selenium 3.4 and greater. and decided to use this version as well.

So, the combination Firefox 52.6.0, Geckodriver 0.17.0 and Selenium 3.4 works. If you have a different requirement, you’ll need to do a trial and error approach similar to above.

Hi I am facing the same issue- "selenium.common.exceptions.WebDriverException: Message: Can’t load the profile. Profile Dir: /tmp/tmpqz86Ue If you specified a log_file in the FirefoxBinary constructor, check it for details. "

I did not change anything with script, I read through the comments, seems like my configuration should work swiftly… I just now changed it to:

Ubuntu 16.04.3 LTS Mozilla Firefox 56.0 geckodriver 0.18.0 selenium-3.7.0

Please respond, I dont see any recent comments assuming the issue is fixed for good, Kindly share the knowledge ASAP! Thanks in advance

Solutions given by @nim4 worked for me +1 Ubuntu 16.04.1 LTS Mozilla Firefox 49.0.1 Mozilla Firefox 50.0.1 Mozilla Firefox 51.0.1 Selenium version: 3.0.0.b3

Any progress on this, still an issue

Same issue with Firefox 49.0 and Selenium 2.53.6 on OSX Removed firefox and installed version 48.0.2 and it had no impact on the issue. Python 3.5