Add support for the new type of "unhandledPromptBehavior" for WebDriver BiDi
Categories
(Remote Protocol :: Agent, task, P2)
Tracking
(firefox128 fixed)
Tracking | Status | |
---|---|---|
firefox128 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 2 open bugs, )
Details
(Whiteboard: [webdriver:m11][webdriver:relnote])
Attachments
(1 file)
Over on https://github.com/w3c/webdriver/pull/1791 we are going to add a new userPromptHandler
capability to the WebDriver session to allow certain prompt handling like beforeunload
for WebDriver BiDi. If WebDriver BiDi is not present or this capability is not set, the session needs to fallback to the unhandledPromptBehavior
capability.
Assignee | ||
Updated•9 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Updated•7 months ago
|
Assignee | ||
Comment 1•7 months ago
|
||
Actually the userPromptHandler
capability was a mistake and we should still use the unhandledPromptBehavior
capability. I fixed that in https://github.com/w3c/webdriver/pull/1808.
Assignee | ||
Comment 2•7 months ago
|
||
I'm also going to remove specific Marionette unit tests for the unhandledPromptBehavior
capability that are already present in wdspec tests, but only leave basic checks for the capability.
Assignee | ||
Comment 3•7 months ago
|
||
Comment 5•6 months ago
•
|
||
Backed out for causing wdspec failures
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | /webdriver/tests/classic/perform_actions/user_prompts.py | test_dismissed_beforeunload - webdriver.error.UnexpectedAlertOpenException: unexpected alert open (500): Unexpected beforeunload dialog detected. Performed handler "dismiss"
Assignee | ||
Comment 6•6 months ago
|
||
Looks like there is a race condition between closing the opened beforeunload
prompt and the alert checks for the next to execute command:
https://treeherder.mozilla.org/logviewer?job_id=459162144&repo=autoland&lineNumber=174837-174843
1716378120924 webdriver::server DEBUG -> GET /session/890e4672-cd75-4fca-8f7f-4220cc0c63b8/url
1716378121076 RemoteAgent TRACE Received observer notification common-dialog-loaded
1716378121077 Marionette TRACE Implicitly accepted "beforeunload" prompt
1716378121117 Marionette DEBUG 0 -> [0,104,"WebDriver:GetCurrentURL",{}]
1716378121126 RemoteAgent TRACE Received event DOMModalDialogClosed
1716378121134 Marionette DEBUG 0 <- [1,104,{"error":"unexpected alert open","message":"Unexpected beforeunload dialog detected. Performed handler \"dismiss\"","stacktrace":"RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Er ... iver/Errors.sys.mjs:800:5\nGeckoDriver.prototype._handleUserPrompts@chrome://remote/content/marionette/driver.sys.mjs:2843:11\n","data":{"text":"This page is asking you to confirm that you want to leave — information you’ve entered may not be saved."}},null]
1716378121139 webdriver::server DEBUG <- 500 Internal Server Error {"value":{"error":"unexpected alert open","message":"Unexpected beforeunload dialog detected. Pe ... Errors.sys.mjs:800:5\nGeckoDriver.prototype._handleUserPrompts@chrome://remote/content/marionette/driver.sys.mjs:2843:11\n"}}
Maybe we have to special-case this prompt type and wait for the beforeunload
prompt got handled before continuing. I'll try to see if I can reproduce by maybe delaying the automatic accepting a bit.
Assignee | ||
Comment 7•6 months ago
|
||
Ok, so for now I would propose that we actually wait in _handleUserPrompt()
until the dialog was closed and then return. This might change again when I implement support for WebDriver BiDi but it can be done in a follow-up bug. I pushed a try build to check that this works:
https://treeherder.mozilla.org/jobs?repo=try&revision=bf928be4d1358954b9ba0ddad4fb022695ee50c9
Comment 9•6 months ago
|
||
bugherder |
Assignee | ||
Updated•5 months ago
|
Description
•