Skip to content

[🐛 Bug]: [dotnet] Webdriver connection gets lost after website closes pop-up window. #17053

@banjand

Description

@banjand

Description

We have an older website that we're testing, and we've been having some issues when pages get closed by the website ( when settings are saved and such ). Basically when trying to navigate back to the original window, sometimes the Driver just loses connection and doesn't work anymore ( it'll give an error like this one when trying to switch to another window ).

2026-02-04 18:23:40,117 ERROR EditorialManagerTestLibrary.Automation.Logger - [METHOD: SafeGetWindowHandles - Line 823 in /githubrunner/_work/editorialmanager-test-automation/editorialmanager-test-automation/EditorialManagerTest/Automation/Browsers.cs] Failed to get window handles, driver connection may be lost: An unknown exception was encountered sending an HTTP request to the remote WebDriver server for URL http://localhost:33035/session/01b33f5d6d060cb5c70cc7a028052492/window/handles. The exception message was: Cannot assign requested address (localhost:33035)

Reproducible Code

call
driver.WindowHandles

right after a pop-up window closes (without it being closed by the driver, rather be closed by the website itself)

Debugging Logs

2026-02-04 18:23:40,117 ERROR EditorialManagerTestLibrary.Automation.Logger - [METHOD: SafeGetWindowHandles - Line 823 in /githubrunner/_work/editorialmanager-test-automation/editorialmanager-test-automation/EditorialManagerTest/Automation/Browsers.cs] Failed to get window handles, driver connection may be lost: An unknown exception was encountered sending an HTTP request to the remote WebDriver server for URL http://localhost:33035/session/01b33f5d6d060cb5c70cc7a028052492/window/handles. The exception message was: Cannot assign requested address (localhost:33035)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-dotnet.NET BindingsI-defectSomething is not working as intendedOS-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions