Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

could you give me any suggestions how to solve the weird problem I experience with webdriver? I like to use webdriver to control the browser from the Tor Browser Bundle (TBB). Controlling the TBB via webdriver works perfectly fine on Linux, as long as you initialize the webdriver with the default profile.

However on Windows the same code makes webdriver experience problems with loading that profile, despite its path being correct. (It is critical for me to run the application on Windows.)

Firefox itself displays the following error message:

  Your Firefox profile cannot be loaded. It may be missing or inaccessible.

Yet, the browser loads totally fine with all extensions and running Tor service! However the exception kills the webdriver script and therefore the webautomation sequence is cancelled.

Has anybody any suggestions how to overcome this problem? What additional information may you require?

Thank You very much in advance!

-Bernd

My code (python):

  profile = FirefoxProfile(BROWSER_PROFILE_PATH)
  firefox_binary = FirefoxBinary(BROWSER_PATH)
  driver = webdriver.Firefox(profile, firefox_binary)

Strangely I get two different error messages running the exact same code.

Error 1 - WindowsError: [Error 145]:

File "H:\webdriver_project\web_test.py", line 153, in web_test
driver = webdriver.Firefox(profile, firefox_binary)
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 59,   in __init__
self.binary, timeout),
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox extension_connection.py", line 45, in __init__
self.profile.add_extension()
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 92, in add_extension
self._install_extension(extension)
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 285, in _install_extension shutil.rmtree(tmpdir)
File "C:\Python27\lib\shutil.py", line 245, in rmtree rmtree(fullname, ignore_errors, onerror)
File "C:\Python27\lib\shutil.py", line 245, in rmtree rmtree(fullname, ignore_errors, onerror)
File "C:\Python27\lib\shutil.py", line 254, in rmtree onerror(os.rmdir, path, sys.exc_info())
File "C:\Python27\lib\shutil.py", line 252, in rmtree os.rmdir(path)
WindowsError: [Error 145] The directory is not empty: 'c:\\users\\user1\\appdata\\local\\temp\\tmpdtgwyq.webdriver.xpi\\resource\\modules'

Error 2 - WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: '

  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 59, in __init__
self.binary, timeout),
 File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
self.binary.launch_browser(self.profile)
 File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 61, in launch_browser
self._wait_until_connectable()
 File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 100, in _wait_until_connectable
self._get_firefox_output())
WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: '
(No output)
share|improve this question

1 Answer 1

First of all, try the solution suggested here.


Also you can try the following [source]

  1. First of all, try resetting Firefox:

  2. If this doesn’t help, try to remove your old profile and create a new one manually via Firefox Profile Manager:

  3. If this still doesn’t work, try deleting the profile.ini file to force Firefox to create a new default profile:

    • Make sure that Firefox is closed
    • Press Windows key+R to open the Run box
    • Type: %APPDATA%\Mozilla\Firefox
    • Click “OK”
    • Delete the file called “profile.ini”
    • Run Firefox again
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.