Skip to content

[🐛 Bug]: Alert doesn't show up in Chrome with Selenium in automated tests #16230

@elinashykhalieva

Description

@elinashykhalieva

Description

In java, selenium=4.2.0
ChromeDriver 139.0.7258.138
A few months ago we started using enable_bidi in chrome options to work around an issue with chrome where in selenium tests we could not capture a "are you sure you want to leave this page, you have unsaved changes" type alert.
A few months ago we faces with an issue with chrome where in selenium tests we could not capture a "are you sure you want to leave this page, you have unsaved changes" type alert.
As a workaround we added to ChromeOptions:
options.setCapability("webSocketUrl", true);
options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);
And it fixed problem - we were able to see alerts in the UI and interact with them.

Today they no longer work (no capture the alert on leaving page, chrome never shows it)

Do you know reason for that and how it can be fixed?

Reproducible Code

ChromeOptions: 
options.setCapability("webSocketUrl", true);
options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);

ℹ️ Last known working version: 4.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava BindingsD-chromeI-defectSomething is not working as intendedI-questionApplied to questions. Issues should be closed and send the user to community resources.I-regressionSomething was working but we "fixed" itJ-awaiting answerQuestion asked of user; a reply moves it to triage againOS-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions