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 -
- Open the browser
- and open the url (https://www.baidu.com)
Actual Behavior -
- Open the browser
- quit the browser
- 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 -
- Run the script
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://www.baidu.com')
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