question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python Firefox webdriver can fail on slow systems

See original GitHub issue

When I try to load Firefox webdriver in python using: webdriver.Firefox()

It occasionally fails after around 30 seconds with below traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 77, 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 103, in _wait_until_connectable
    raise WebDriverException("Can't load the profile. Profile "
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.

I am almost sure it’s to do with hardcoded 30 seconds timeout in firefox_binary.py:101. When I changed that value to 60 it started working.

I tried to load webdriver like this: webdriver.Firefox(timeout=60)

but after looking at the code the timeout is not actually used so made no difference

How to replicate:

  • this issue can only be seen on slow systems (like RaspberryPi) where firefox takes over 30 seconds to start
  • the following python code can be used to replicate the problem:
from selenium import webdriver
browser = webdriver.Firefox()

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
peletiahcommented, Aug 2, 2016

Issue does not seem to be caused by a slow machine. I’m running into the same problem with an i5-4570T.

0reactions
HackTodaycommented, Nov 1, 2016

I am using selenium 2.53.1 and Firefox 45.0。2, can hit above issue occasionally

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Firefox webdriver can fail on slow systems · Issue #1300
When I try to load Firefox webdriver in python using: webdriver.Firefox() It occasionally fails after around 30 seconds with below ...
Read more >
Selenium GeckoDriver is slow to launch Firefox Browser
1 Answer 1 · Your Selenium Client version is unknown to us. · Your GeckoDriver version is v0.19.1. · Your Firefox version is...
Read more >
Your Selenium Tests are not Slow because of ... - Alex Siminiuc
From time to time, I hear people saying that Selenium automated tests are too slow. And they blame the Selenium WebDriver framework for...
Read more >
Selenium WebDriver capabilities for running tests on ...
Default & BrowserStack specific capabilities for Automate, to run Selenium WebDriver tests with support for Local Testing, Debugging and 3000+ Mobile ...
Read more >
Why is WebDriver slower than selenium-client? (Ruby)
After spending a bunch more time looking at this, I realised a lot of the slowness I'm perceiving is due to Firefox starting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found