0

When I try to run a functional test that opens a browser (Firefox) using Selenium, I get a strange message that I can't make sense of. I've already updated Selenium using pip install --upgrade selenium, as well as re-installed the latest Firefox, and it didn't help. Here's the full text of my error message. Any suggestions?

EE
======================================================================
ERROR: test_can_login (__main__.NewVisitorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "functional_tests.py", line 12, in setUp
    self.browser = webdriver.Firefox()
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 85, in __init__
    keep_alive=True)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 234, in execute
    response = self.command_executor.execute(driver_command, params)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 401, in execute
    return self._request(command_info[0], url, body=data)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 432, in _request
    resp = self._conn.getresponse()
  File "C:\Python27\lib\httplib.py", line 1132, in getresponse
    response.begin()
  File "C:\Python27\lib\httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "C:\Python27\lib\httplib.py", line 409, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "C:\Python27\lib\socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the remote host

======================================================================
ERROR: test_can_register (__main__.NewVisitorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "functional_tests.py", line 12, in setUp
    self.browser = webdriver.Firefox()
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 81, in __init__
    self.binary, timeout)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 51, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 98, in _wait_until_connectable
    raise WebDriverException("The browser appears to have exited "
WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.


----------------------------------------------------------------------
Ran 2 tests in 14.789s

FAILED (errors=2)
David J.
  • 1,753
  • 13
  • 47
  • 96
  • 7
    I would check out the answer here. Easy answer is downgrade firefox or download the marionette webdriver [Can't open browser with selenium after firefox update](http://stackoverflow.com/questions/37761668/cant-open-browser-with-selenium-after-firefox-update) – jharrison12 Jun 16 '16 at 21:27

1 Answers1

2

If you are using FirefoxDriver and you have Firefox 47 installed you should look into using the MarionetteDriver instead because Mozilla is switching to Marionette.

Anthony
  • 80
  • 1
  • 10