Skip to content

[docs] decision: browser user prompts are handled through a typed handler API#17672

Open
AutomatedTester wants to merge 1 commit into
trunkfrom
adr-bidi-user-prompts
Open

[docs] decision: browser user prompts are handled through a typed handler API#17672
AutomatedTester wants to merge 1 commit into
trunkfrom
adr-bidi-user-prompts

Conversation

@AutomatedTester

Copy link
Copy Markdown
Member

💥 What does this PR do?

Proposes a design decision record: browser user prompts are handled through a typed handler API.

JavaScript dialogs (alert/confirm/prompt/beforeunload) block the page until handled. WebDriver Classic only exposes them reactively via switch_to.alert, which races the dialog opening and can't pre-decide behaviour. BiDi models them properly (userPromptOpened/handleUserPrompt/userPromptClosed + the unhandledPromptBehavior capability). This record proposes a consistent handler API across bindings: a persistent and a one-shot handler that receive a typed UserPrompt (.type/.message/.default_value/.accept(text)/.dismiss()), with dismiss-by-default when no handler is registered so a stray dialog never hangs the session. The static capability route stays for fixed session policies; expect_user_prompt stays for the assert-it-appeared case.

🔧 Implementation Notes

🤖 AI assistance

  • AI assisted (complete below)
    • Tool(s): Claude Code
    • What was generated: Initial draft of the decision record, derived from a CDDL-validated comparison of the Python BiDi surface against Playwright; revised through discussion and review
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

One of a set of BiDi ergonomics decision records proposed together. Cross-binding convergence is tracked in the record's binding-status table.

🔄 Types of changes

  • Documentation (design decision record)

@AutomatedTester AutomatedTester force-pushed the adr-bidi-user-prompts branch from ad2fdf9 to c096920 Compare June 11, 2026 18:28
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

Successfully merging this pull request may close these issues.

1 participant