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

Created on 8 Sep 2016  Â·  30Comments  Â·  Source: SeleniumHQ/selenium

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 -

  3. Open the browser

  4. quit the browser
  5. 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')
C-py D-firefox

Most helpful comment

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

All 30 comments

I'm having the same problem with Selenium 2.53.6, Firefox 48.0.2. It opens the browser, waits for around a minute, and then gives me this error and the browser closes.

+1

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

I'm having this problems on Windows 7, Selenium 2.53.6, Firefox 48.0.2, Python 3.5.1 (64-bit) I've tried passing a created profile, to no effect:

    binary = FirefoxBinary("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe")
    fp = webdriver.FirefoxProfile()
    driver = webdriver.Firefox(firefox_binary=binary, firefox_profile=fp)

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

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

Confirm exact same scenario.
Can also add I'm on Yosemite 10.10.5

Same issue with Firefox 49.0 and Selenium 2.53.6 on Ubuntu 14.04 and Python 2.7

Thank you, @BroncaDonk, I wasn't sure which combinations of FF/Selenium would work, Now I can get back to writing code.

Same issue, any idea to patch this problem ?

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)

I have this issue now. I'll try the solution that @Polku and @BroncaDonk are employing.

+1 of bug on Ubuntu 16.04, Python 3.5, Selenium2.53.6 and Firefox 49.

+1 confirm workaround by @BroncaDonk and @polku

Also bug with Mac OSX 10.11.5, Python 2.7.11, Selenium 2.53.1

Fixed by workaround from @polku and @BroncaDonk

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.

thanks @lukeis but how do you use gecko driver. I don't understand it

@VincentSim I guess we're supposed to follow this : https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver, personally I can't get it to work with FF 49, maybe a new issue should be open or maybe I'm just doing something wrong, but I will just stick to my workaround for now.

@polku

I would love to hear what issues you are having as it sounds like you are having an atypical time with Marionette. Please raise a separate bug for that

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

+1 for Mac El Capitan 10.11.6

Any progress on this, still an issue

I am getting the same error:
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmpdtte10p9 If you specified a log_file in the FirefoxBinary constructor, check it for details.

Observation 1:

  • OS: Arch Linux
  • Firefox: 49.0.2
  • Python: 3.5.2
  • Selenium: 2.53.1

Observation 2:

  • OS: Arch Linux
  • Firefox: 49.0.2
  • Python: 3.5.2
  • Selenium: 3.0.1

Observation 3:

  • OS: OS X El Capitan
  • Firefox: 49.0.2
  • Python: 3.5.2
  • Selenium: 3.0.1

Observation 4:

  • OS: OS X El Capitan
  • Firefox: 49.0.2
  • Python: 3.5.2
  • Selenium: 2.53.1

I also tried using Chrome and it is throwing a different error. Since the error is different, I will post it separately, but the test script I am using was working fine with both Chrome and Firefox the last time I worked on it. Of course, everyone who says that is lying, even if they aren't. :)

+1 for this issue.
OS: Ubuntu 14.04
Firefox: 50.0.2
Python: 3.4.3
Selenium: 3.0.2

+1 for this issue.
OS: MacOS Sierra 10.12.1
Firefox: 49.0.2
Python: 3.5.2
Selenium: 3.0.1

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

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

Well, i am still having this issue as well. tried all the tips here but does not seem to work.

selenium==3.8.1
geckodriver 0.19.1
Mozilla Firefox 58.0

from selenium import webdriver
driver = webdriver.Firefox()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 79, in __init__
self.binary, timeout),
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 49, in __init__
self.binary.launch_browser(self.profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 106, in _wait_until_connectable
% (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmpB5OCnn If you specified a log_file in the FirefoxBinary constructor, check it for details.

Here's a funny observation.

I have selenium 3.8.0, geckodriver 0.20.0 and firefox 59.0.1 on Fedora 27.

With Python 3.6.4, everything works. With 3.7.0b2, firefox has no robot icon in url bar, the url bar is not orange. after a while, firefox segfaults and the exception is displayed.

WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmpnoossqaz If you specified a log_file in the FirefoxBinary constructor, check it for details.

Segfault details at https://bugzilla.redhat.com/show_bug.cgi?id=1510566

@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.

We are facing same issue with Firefox 60.3.0, Geckodriver 0.23.0 and Selenium 3.14.0 on CentOS environment.
Any suggestions?
error message

@Manoj-dsm I suggest changing your dependencies versions. It's a trial and error approach.

I would try a mininum requirements approach from https://searchfox.org/mozilla-central/source/testing/geckodriver/CHANGES.md:

0.21.0 (2018-06-15)

Note that with this release of geckodriver the minimum recommended
Firefox and Selenium versions have changed:

  • Firefox 57 (and greater)
  • Selenium 3.11 (and greater)

A suggestion would be Firefox 57, geckodriver 0.21.0 and Selenium 3.11. I didn't test it though.

Was this page helpful?
0 / 5 - 0 ratings