teamcapybara / capybara

Acceptance test framework for web applications
http://teamcapybara.github.io/capybara/
MIT License
10.03k stars 1.45k forks source link

Google Chrome selenium drivers broken on MacOS because of search engine selection modal #2769

Open vrodic opened 3 months ago

vrodic commented 3 months ago

Meta

Capybara Version: 3.40

Driver Information (and browser if relevant): selenium_chrome and selenium_chrome_headless

PR https://github.com/teamcapybara/capybara/pull/2768 solves this issue.

Expected Behavior

There should be no search engine selection modal.

Actual Behavior

It prevents automated tests from working correctly with errors like Selenium::WebDriver::Error::UnknownError: unknown error: failed to close window in 20 seconds or Selenium::WebDriver::Error::InvalidArgumentError: invalid argument: 'handle' must be a string

Screenshot 2024-08-21 at 12 43 34

Steps to reproduce

Any Capybara code running on MacOS with selenium_chrome and selenium_chrome_headless has this issue.

twalpole commented 3 months ago

If you know what option to pass to chrome to prevent if from showing the modal you can update your driver config to send that option

vrodic commented 3 months ago

If you know what option to pass to chrome to prevent if from showing the modal you can update your driver config to send that option

this is about built-in configurations (called selenium_chrome and selenium_chrome_headless) being broken because of this new behaviour from Chromium

bkleinen commented 2 months ago

this fixed it for me in rails:

  driven_by :selenium, using: config.driver, 
    screen_size: [1400, 1400],
    options: config.driver_options do |driver_option|
        driver_option.add_argument('--disable-search-engine-choice-screen')
    end