Skip to content

Intermittent ReadTimeoutError (HTTPConnectionPool localhost) during long SeleniumLibrary execution with Chrome freezing #1992

Description

@chneyya-ops

Hi,

We are experiencing intermittent ReadTimeoutError failures during long Robot Framework executions using SeleniumLibrary.

The issue is difficult to reproduce consistently, but it occurs frequently during large execution batches.

Environment

  • Robot Framework: Robot Framework 7.3.2 (Python 3.12.0 on win32)
  • SeleniumLibrary: 6.8.0
  • Selenium: 4.36.0
  • Chrome: 149.0.7827.200 (64-bit)
  • Windows 11

Error

ReadTimeoutError:
HTTPConnectionPool(host='localhost', port=xxxxx):
Read timed out. (read timeout=120)

Sometimes we also see:

Timed out receiving message from renderer

Behavior

The browser visibly freezes when this happens.

The failure is intermittent and can occur in different Selenium keywords, for example:

  • Click Element
  • Wait Until Element Is Visible
  • Wait Until Page Loaded
  • Set Selenium Page Load Timeout

It most commonly happens during:

  • Logout
  • Navigating to the Browse module after switching back to the main window

However, it is not limited to those locations. The same timeout can occur in different tests at different steps.

Additional observations

  • A new browser is launched for every test case.
  • Failures are random and not tied to one specific test.
  • The application is still running, but Chrome becomes unresponsive.
  • Selenium waits for approximately 120 seconds before raising the ReadTimeoutError.

##Log excerpt

Wait Until Page Loaded  
00:10:00.795KEYWORD 02_Browse_POM . Click On the Browse Module  
Start / End / Elapsed: | 20260706 15:04:20.439 / 20260706 15:14:21.234 / 00:10:00.795 -- | --

Question

Has anyone experienced similar intermittent browser freezes resulting in HTTPConnectionPool(host='localhost') ReadTimeoutError?

Is this known to be related to SeleniumLibrary, Selenium Python, ChromeDriver, Chrome, or is there anything we should investigate further?

Any suggestions would be greatly appreciated.

Activity

  1. yuriverweij commented on Jul 15, 2026

    @yuriverweij
    Member

    Thanks for the detailed report!

    From what you describe, I don't think this is a SeleniumLibrary timeout. The "HTTPConnectionPool(host='localhost', ...)" error looks like Selenium is waiting for ChromeDriver/Chrome to respond, which would also match Chrome freezing.

    That would also explain why it happens on different keywords. The keyword in the log is probably just the one running when Chrome stops responding.

    Since you start a new browser for every test, could you check if Chrome or ChromeDriver processes are building up during the run?

    Could you also share the full traceback of the "ReadTimeoutError"?

    And one thing I'm curious about: when Chrome is frozen like this, does "Close All Browsers" still work, or does that time out as well?

  2. chneyya-ops commented on Jul 16, 2026

    @chneyya-ops
    Author

    Hello, thanks for replying.

    I searched the output.xml, but it only contains the exception message and retry information. I couldn't find a Python traceback. The recorded error is:

    ReadTimeoutError:
    HTTPConnectionPool(host='localhost', port=61103):
    Read timed out. (read timeout=120)

    along with repeated retry messages and failures to execute Capture Page Screenshot because the session is no longer responding.

    Is there a way to enable a full Python traceback for this type of exception? Robot Framework's output.xml appears to contain only the exception message rather than the underlying stack trace.

    We did implement a temporary workaround for one specific scenario where this occurs during sign out.

    In our framework, the logout keywords are wrapped with Run Keyword And Ignore Error. If the returned error message contains either ReadTimeoutError or HTTPConnectionPool, we treat the browser as unresponsive, disable the run-on-failure screenshot, and attempt to Close Browser so the execution can continue with the next test instead of waiting for the 120-second timeout.

    We also added similar detection around our click keyword, since the same ReadTimeoutError can occur while executing Click Element or the JavaScript click fallback.

    This is only a workaround on our side—it does not recover the browser session. Once this state is reached, the current test is failed and the browser is discarded so a new browser can be started for the next test.

    Regarding your question about Close All Browsers: once Chrome enters this unresponsive state, we have observed that Selenium commands also stop responding. Our workaround is to attempt to close the browser and then start a fresh browser for the next test, rather than trying to continue using the existing session. We cannot use close all browsers because some times the test cases are running in parallel.

    This is the output.xml of the error faced:

    ${handles}[0] Switches to browser window matching locator. Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120)")': /session/28719ce3d664b255ac59dbe58df06f18/screenshot Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120)")': /session/28719ce3d664b255ac59dbe58df06f18/screenshot Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120)")': /session/28719ce3d664b255ac59dbe58df06f18/screenshot Keyword 'Capture Page Screenshot' could not be run on failure: HTTPConnectionPool(host='localhost', port=61103): Max retries exceeded with url: /session/28719ce3d664b255ac59dbe58df06f18/screenshot (Caused by ReadTimeoutError("HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120)")) ReadTimeoutError: HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120) ${Locator_Browse_on_main_menu} ${TIMEOUT} Waits until the element locator is visible. ReadTimeoutError: HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120) ${Locator_Browse_on_main_menu} Clicks a link identified by locator. 4s Pauses the test executed for the given time. ${Browse_Page_Title} Verifies that the current page title equals title. ReadTimeoutError: HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120) 1s Pauses the test executed for the given time. ReadTimeoutError: HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120) Workflow_User1 ${job_name} ${job_name} ${TIMEOUT} Waits until text appears on the current page. Test that alternate user can return job and process it ReadTimeoutError: HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120) Jira_TCID: BPV-8018 Author :Rajitha PRS ReadTimeoutError: HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120) ${filepath1} 3 Opens xlsx document file. ${sheetname} Returns a page from the current document. ${value} = NONAD ${value} 4 28 Returns content of a cell. Closes all opened documents. ${browser_count} = [11] ${browser_count} Returns index of all active browser as list. ${browser_id} Switches between active browsers using index_or_alias. Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120)")': /session/28719ce3d664b255ac59dbe58df06f18 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120)")': /session/28719ce3d664b255ac59dbe58df06f18 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=61103): Read timed out. (read timeout=120)")': /session/28719ce3d664b255ac59dbe58df06f18 Closes the current browser.

    My guess would be that continuous switching of windows is causing the browser to freeze

  3. yuriverweij commented on Jul 16, 2026

    @yuriverweij
    Member

    Thanks for the additional information!

    You can enable Python tracebacks by running Robot Framework with --loglevel DEBUG.
    That said, I suspect the traceback will mainly show Selenium waiting for ChromeDriver to respond, rather than explain why Chrome became unresponsive.

    The repeated screenshot failures are expected once the browser session stops responding. Capture Page Screenshot is another WebDriver command, so it will also time out when ChromeDriver no longer responds.

    To investigate why Chrome becomes unresponsive, you may also want to enable verbose ChromeDriver logging and Chrome’s own logging. These logs are separate from Robot Framework’s output.xml and may provide more information about what happens before the browser stops responding.

    Your current workaround of discarding the unresponsive browser session and continuing with a new browser seems reasonable.

    Based on the information shared so far, this most likely isn't a SeleniumLibrary issue. I don't think there is anything actionable for us to investigate or change on the SeleniumLibrary side.

  4. emanlove commented on Jul 17, 2026

    @emanlove
    Member

    Bit focused on other tasks so pardon if this was asked and answered. Do you have involved or using selenium grid within your setup? And even if not grid, what does your system and system networking look like? Due to security reason you might not want to share that publiclly but worth having a discussion with the individuals or teams that manage it. I ask because I hvae know systems that have, for example, a load balancer within the system. Thus had timeouts that were causing network communication systems that were not checking their own connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions