Browser WBT on Chrome: avoid "no such window: target window already closed"#1265
Merged
ilonatommy merged 4 commits intomainfrom Sep 10, 2024
Merged
Browser WBT on Chrome: avoid "no such window: target window already closed"#1265ilonatommy merged 4 commits intomainfrom
ilonatommy merged 4 commits intomainfrom
Conversation
Member
Author
|
/ba-g failures not connected. Tested locally - passing without timeouts on the newest Chrome. |
pavelsavara
reviewed
Sep 10, 2024
pavelsavara
approved these changes
Sep 10, 2024
akoeplinger
approved these changes
Sep 10, 2024
Member
Author
|
/ba-g Android was not touched |
This was referenced Sep 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to dotnet/runtime#107466 - when running locally with the new chrome we're getting:
We have while loop that is closing all the tabs but one. Because there might be delays in closing them, the conditions we're checking might not be deterministic. If because of delays
lastWindowHandlewas null, then we cannot dodriver.Navigate().GoToUrl("about:config");in casedriverServiceis still running. It throwsOpenQA.Selenium.NoSuchWindowException: no such window: target window already closedthen. To avoid it, we have to re-check if there's any window to perform this operation on.We're adding an additional delay before final check for
driverService.An alternative would be to add a delay inside of the closing tabs loop, but that would not be deterministic and in case of having many tabs, would prolong the test execution. On the other hand, I haven't seen logs with more than 2 tabs attempting to get closed.