The exception raised in geckodriver does not contain the prompt message anymore. In selenium UnexpectedAlertPresentException we do not have any info anymore what was the content of the automatically dismissed prompt
Current message
"message":"Unexpected alert dialog detected. Performed handler \"dismiss\""
Previous message
"message":"Dismissed user prompt dialog: This is a triggered alert!"
Is this the expected behavior now for geckodriver? For chrome the prompt message is still passed to the exception.
Testcase
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import UnexpectedAlertPresentException
firefox_options = Options()
# firefox_options.unhandled_prompt_behavior = "ignore"
firefox_options.log.level = "trace"
service = Service(executable_path=geckodriver_path, log_output="trace.log")
driver = webdriver.Firefox(service=service, options=firefox_options)
try:
driver.get("data:text/html,<html><body></body></html>")
driver.execute_script("alert('This is a triggered alert!');")
assert driver.switch_to.alert.text
driver.title # Trigger unexpected alert
assert False, "No exception"
except UnexpectedAlertPresentException as e:
print(f"Exception: {e}")
print(e.msg)
finally:
driver.quit()
1728527680840 webdriver::server DEBUG <- 500 Internal Server Error {"value":{"error":"unexpected alert open","message":"Dismissed user prompt dialog: This is a tri ... Errors.sys.mjs:800:5\nGeckoDriver.prototype._handleUserPrompts@chrome://remote/content/marionette/driver.sys.mjs:2835:13\n"}}
System
Description
The exception raised in geckodriver does not contain the prompt message anymore. In selenium
UnexpectedAlertPresentException
we do not have any info anymore what was the content of the automatically dismissed promptCurrent message
Previous message
Is this the expected behavior now for geckodriver? For chrome the prompt message is still passed to the exception.
Testcase
Stacktrace
Trace-level log
Attached file trace.log
Old Trace log from Firefox 125.0.1 trace.log
-->