Currently our handling of prompts and other alerts isn't ideal
For alert() and friend you always have to subscribe to the events and handle an alert explicitly. If you aren't subscribed then the session will be blocked indefinitely on the alert with no way for the client to know what to do.
For file pickers, https://github.com/w3c/webdriver-bidi/pull/535 currently has a proposal to auto-dismiss if there's an event subscription, relying on the fact that setFiles can be called even if the file-picker isn't displayed.
Generally we probably want something that allows specifying the behaviour. For the file dialog case, it seems reasonable that in some cases I might want to know that there's a file dialog, but I might not want to dismiss it without either user interaction or the setFiles command. And for the alert() case it seems likely that there's cases where I just don't care about the alerts and want them to always be auto-dismissed.
So possibly the solution here is something like WebDriver's user prompt handling capability, that would allow a session to set up how it wants to handle user prompts, maybe on a case-by-case basis.
Currently our handling of prompts and other alerts isn't ideal
alert()
and friend you always have to subscribe to the events and handle an alert explicitly. If you aren't subscribed then the session will be blocked indefinitely on the alert with no way for the client to know what to do.setFiles
can be called even if the file-picker isn't displayed.Generally we probably want something that allows specifying the behaviour. For the file dialog case, it seems reasonable that in some cases I might want to know that there's a file dialog, but I might not want to dismiss it without either user interaction or the
setFiles
command. And for thealert()
case it seems likely that there's cases where I just don't care about the alerts and want them to always be auto-dismissed.