Open Bug 1925934 Opened 29 days ago Updated 8 days ago

Geckodriver should forward the text property of unexpected alert open errors

Categories

(Remote Protocol :: Agent, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=rust][webdriver:m14])

Follow up to 1924469

Per spec, the unexpected alert open error should include a text property containing the dialog message but geckodriver does not forward it correctly at the moment.

We probably do not forward the text field of an error for all types of errors. Given that we were unsure if that is really needed we should get this discussed in the W3C group before adding support for it to geckodriver.

See as well the discussion on https://github.com/w3c/webdriver/issues/1615. Selenium grid is using the data field for additional information. So maybe we should keep supporting it and get the field forwarded by geckodriver in the above mentioned scenario.

For reference, from the initial geckodriver issue, the reporter shared this code which seems to indicate that Chrome exposes the alert text directly:

https://github.com/mozilla/geckodriver/issues/2204

firefoxPrefix = 'Dismissed user prompt dialog: '
if exc.alert_text:
      alertText = exc.alert_text  # from chrome
elif exc.msg and exc.msg.startswith(firefoxPrefix):
      alertText = exc.msg.removeprefix(firefoxPrefix)

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)
Mentor: hskupin
Severity: -- → S3
Flags: needinfo?(hskupin)
Priority: -- → P3
Whiteboard: [lang=rust][webdriver:m14]

The starting point here would be around the following lines in the errors module of the webdriver crate:
https://searchfox.org/mozilla-central/source/testing/webdriver/src/error.rs#294

Also see the following example in how it would look like so that we can create a simple test that checks for the type in case data was specified.

You need to log in before you can comment on or make changes to this bug.