Skip to content

Conversation

@Osseta
Copy link

@Osseta Osseta commented Sep 3, 2025

This PR adds tests to demonstate that handling browser beforeUnload prompts stopped working in Chrome 137 and later.

The test runs on chrome 135,136,138,139.

versions 135 & 136 pass
versions 138 & 139 fail.

$ bundle install
$ bundle exec rake spec_multi_chrome

Failures:

  1) testing with chrome_139 should accept browser modal
     Failure/Error: raise Capybara::ModalNotFound, "Unable to find modal dialog#{" with #{text}" if text}"

  2) testing with chrome_138 should accept browser modal
     Failure/Error: raise Capybara::ModalNotFound, "Unable to find modal dialog#{" with #{text}" if text}"

Finished in 10.22 seconds (files took 0.59535 seconds to load)
4 examples, 2 failures

Failed examples:

rspec './spec/selenium_spec_multi_chrome.rb[1:4]' # testing with chrome_139 should accept browser modal
rspec './spec/selenium_spec_multi_chrome.rb[1:3]' # testing with chrome_138 should accept browser modal

The test is simple:

    session.visit('/with_unload_alert')
    session.fill_in 'data', with: 'this is data'
    session.accept_confirm do
      session.click_link('Go away')
    end
    expect(session).to have_text('Hello world')

In chrome 137 and later the modal is never shown and instead the link is followed without prompting.

@Osseta
Copy link
Author

Osseta commented Sep 5, 2025

There is a bug in selenium-webdriver as discussed on this issue. #2824

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