w3c / w3c/webdriver

Make default unhandled prompt behavior crystal clear

Open
#1,135 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
HTML
Stars
718
Forks
228
PR merge metrics
No merged PRs in 30d

Description

In chapter 18. User Prompts:

By default user prompts are not handled automatically unless a user prompt handler has been defined. When a user prompt appears, it is the task of the subsequent command to handle it. If the subsequent requested command is not one listed in this chapter, an unexpected alert open error will be returned.

This essentially means that by default remote end should not dismiss prompts. However, once reading spec more it becomes obvious that by default it has to dismiss prompt and return error. In the step 2 of the steps remote end should follow, the default behavior is:

mssing value default state
not in the table of simple dialogs

  1. Dismiss the current user prompt.
  2. Return an annotated unexpected alert open error.

So, essentially, the paragraph above should be changed to something like this:

When a user prompt appears, it is the task of the subsequent command to handle it. If the subsequent requested command is not one listed in this chapter, a user prompt will be dismissed and an unexpected alert open error will be returned.

Also, a bit of logs from #selenium IRC:

[17:06:02]  simonstewart p0deje: Lemme pull up the spec
[17:06:32]  simonstewart That's the bit
[17:06:51]  simonstewart So, unless it's been set, the value for the current session's user prompt handler is "null"
[17:07:25]  simonstewart So we fall through to the bottom condition in step 2
[17:07:39]  simonstewart Where we
[17:07:44]  simonstewart Dismiss the current user prompt.
[17:07:49]  simonstewart Return an annotated unexpected alert open error.
[17:07:54]  simonstewart That seems pretty clear
[17:09:19]  p0deje ah
[17:09:33]  p0deje I understood this is done only when "not in the table of simple dialogs"
[17:09:59]  simonstewart "missing value, default state"
[17:10:03]  simonstewart too

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with chapter 18, User Prompts, at the linked WebDriver specification section and compare the introductory paragraph with the quoted default-state steps. Update the wording so it clearly describes dismissing the prompt and returning an unexpected alert open error; the chapter text should consistently reflect that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.