Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the Chrome search engine selector by default #2768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dgmstuart
Copy link

In recent versions of Chrome, a search engine selection modal is shown when first opening the browser, which causes specs to fail with errors like this:

Selenium::WebDriver::Error::UnknownError:
        unknown error: failed to close window in 20 seconds
          (Session info: chrome=128.0.6613.36)

Presumably this is because the spec is trying to interact with the browser but can't get past the selection screen.

This seems to be a common issue:

Adding this option appears to fix it, but I've only tested by defining my own driver locally with this argument - not sure how I'd write a spec for this driver definition?

Also I'm not sure if this option is defined for older versions of Chrome (or is it chromedriver?) - would this result in errors when using a version where this option isn't supported?

In recent versions of Chrome, a search engine selection modal is shown when first opening the browser, which causes specs to fail  with errors like this:

    Selenium::WebDriver::Error::UnknownError:
            unknown error: failed to close window in 20 seconds
              (Session info: chrome=128.0.6613.36)

Presumably this is because the spec is trying to interact with the browser but can't get past the selection screen.

This seems to be a common issue:

- https://stackoverflow.com/questions/78831994/how-to-skip-choose-search-engine-with-capybara-selenium-chrome
- https://www.reddit.com/r/learnpython/comments/1eoapcb/selenium_dosent_find_google_search_engine_option/

Adding this option appears to fix it, but I've only tested by defining my own driver locally with this argument - not sure how I'd write a spec for this driver definition?

Also I'm not sure if this option is defined for older versions of Chrome (or is it chromedriver?) - would this result in errors when using a version where this option isn't supported?
@vrodic
Copy link

vrodic commented Aug 21, 2024

I confirm this is a problem specifically on MacOS. It breaks headless tests. On Linux the latest Chrome doesn't show this nag screen. But it's safe to add this option on all platforms.

@dgmstuart
Copy link
Author

I confirm this is a problem specifically on MacOS. It breaks headless tests. On Linux the latest Chrome doesn't show this nag screen. But it's safe to add this option on all platforms.

Interesting - If it's not there yet on Linux, then I guess it's coming - seems like it's a legal requirement that's been imposed on them by the EU so I'd expect it to eventually be on all platforms: https://www.google.com/chrome/choicescreen/

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.

2 participants