webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

Is "close window" expected to wait for the window to be closed?

Open gsnedders opened this issue 1 year ago • 1 comments

https://w3c.github.io/webdriver/#close-window calls HTML's https://html.spec.whatwg.org/#close-a-browsing-context, but as far as I'm aware that doesn't synchronously close the window. I think in most implementations by the point that it returns it always will have closed the window, but the spec doesn't seem to guarantee this?

(Note that for HTTP-only sessions before unload is never fired, thus I believe it should always eventually succeed.)

gsnedders avatar Oct 28 '24 21:10 gsnedders

I believe steps 4 and 5 implicitly cover this, but I agree it would be helpful to provide a clearer description. Additionally, it would be beneficial to explicitly state that one of the remaining open windows should have the focus set (i.e., be the active window). Without this clarification, there could be cases where no active window is present because the flag hasn't yet been set to the next window in the z-order.

whimboo avatar Oct 29 '24 06:10 whimboo