w3c / webdriver

Remote control interface that enables introspection and control of user agents.
https://w3c.github.io/webdriver/
Other
676 stars 190 forks source link

Take Screenshot command missing "Handle any user prompts" step #1678

Open patrickangle opened 1 year ago

patrickangle commented 1 year ago

https://w3c.github.io/webdriver/#take-screenshot

It appears that the spec is missing a step for the Take Screenshot command to handle user prompts after ensuring there is a browsing context and before taking the screenshot (between steps 1 and 2). There are WPT tests that rely on user prompts being handled (https://wpt.fyi/results/webdriver/tests/take_screenshot/user_prompts.py), so it seems like an accidental omission.

It appears Chrome, Edge, and Firefox already handle these prompts and Safari is the only browser not doing so anyways (we also have another bug preventing us from handling prompts in any test, but we don't even attempt to handle prompts for the take screenshot command currently).

Should the spec be updated, or am I missing something here? If there are no objections I can submit a PR to add the step.