selenium icon indicating copy to clipboard operation
selenium copied to clipboard

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

Open WooHooDai opened this issue 10 years ago • 30 comments

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')

WooHooDai avatar Sep 08 '16 08:09 WooHooDai

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.

ghost avatar Sep 14 '16 22:09 ghost

+1

stringertheory avatar Sep 15 '16 04:09 stringertheory

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

oden3000 avatar Sep 15 '16 06:09 oden3000

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)

schodge avatar Sep 15 '16 23:09 schodge

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

BroncaDonk avatar Sep 16 '16 16:09 BroncaDonk

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

Shattoww avatar Sep 16 '16 21:09 Shattoww

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

seifer08ms avatar Sep 18 '16 02:09 seifer08ms

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

ghost avatar Sep 18 '16 04:09 ghost

Same issue, any idea to patch this problem ?

VincentSim avatar Sep 23 '16 14:09 VincentSim

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)

polku avatar Sep 23 '16 15:09 polku

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

aisflat439 avatar Sep 23 '16 16:09 aisflat439

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

+1 confirm workaround by @BroncaDonk and @polku

wiheto avatar Sep 23 '16 23:09 wiheto

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

Fixed by workaround from @polku and @BroncaDonk

nattyait avatar Sep 26 '16 04:09 nattyait

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.

lukeis avatar Sep 26 '16 05:09 lukeis

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

VincentSim avatar Sep 26 '16 07:09 VincentSim

@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 avatar Sep 26 '16 09:09 polku

@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

AutomatedTester avatar Sep 26 '16 12:09 AutomatedTester

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

nim4 avatar Sep 28 '16 09:09 nim4

+1 for Mac El Capitan 10.11.6

3LP avatar Oct 06 '16 17:10 3LP

Any progress on this, still an issue

DoDSoftware avatar Nov 10 '16 12:11 DoDSoftware