Python Firefox webdriver can fail on slow systems
See original GitHub issueWhen 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:
- Created 8 years ago
- Comments:12
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Issue does not seem to be caused by a slow machine. I’m running into the same problem with an i5-4570T.
I am using selenium 2.53.1 and Firefox 45.0。2, can hit above issue occasionally