Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent close of Bidi tab when calling closeWindow classic #2965

Closed
christian-bromann opened this issue Jan 9, 2025 · 5 comments
Closed

Comments

@christian-bromann
Copy link
Contributor

If some calls the WebDriver classic command closeWindow it will close the whole window including the Bidi tab which makes it impossible (from a framework perspective like WebdriverIO) to re-act on it and open a new window.

What are your recommendations here or would you consider this a bug in Chromedriver?

@OrKoN
Copy link
Collaborator

OrKoN commented Jan 9, 2025

I think it is a bug in ChromeDriver (possible a regression). I do not think the window with the bidi tab should be observable.

@OrKoN
Copy link
Collaborator

OrKoN commented Jan 9, 2025

@sadym-chromium PTAL

@sadym-chromium
Copy link
Collaborator

Closing last tab should close the session and the browser, and I believe it's the way ChromeDriver works in pure classic mode as well. From your perspective, what is the expected behavior after the last tab is closed? Please note that Mapper tab is transparent for the protocol.

@christian-bromann
Copy link
Contributor Author

what is the expected behavior after the last tab is closed?

I actually learned that the session is being closed when all windows are being closed. Now this all makes sense as I tried to call browsingContextCreate which just started to hang the process since WebdriverIO never received a socket response.

Honestly I would have expected that the session remains open and I can open a new tab to continue while other commands that require a window would fail. Closing the session should only happen via the session.end IMHO. This gives me as a framework author a mean to recover from an unwanted situation where all windows got closed unintentionally.

I am sure there is a good reason to also just close the issue. Feel free to close the issue as it works as defined in the spec. Thanks for your input!

@OrKoN
Copy link
Collaborator

OrKoN commented Jan 11, 2025

Looks like I misunderstood the original issue, the WebDriver spec indeed says that the session must end if no more top-level browsing contexts remain open according to https://w3c.github.io/webdriver/#close-window (in that sense the bidi tab is not observable as it does not prevent ending the session).

@OrKoN OrKoN closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants