Closed Pepan closed 2 weeks ago
@Pepan, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
solution : --disable-search-engine-choice-screen
send this option to Chrome
driven_by :selenium, using: :chrome, screen_size: [1400, 1400] do |driver_option|
driver_option.add_argument '--disable-search-engine-choice-screen'
end
Hello @Pepan just to double check this doesn't seem to be a selenium issue, since I cannot reproduce it but on your test you were not able to select the right window and you needed to disable the search engine selection option
if that's the case I will propose to close this
Hello @aguspe, no.
Look at screenshots.
After I add argument (see my above reply) it starts working again. So it starts to happening without developers intervention and dev. can do nothing to solve it. ... it is caused probably by EU rules which Google must follow ... I guess. Maybe in your country this "choose search engine screen" does not appear.
https://www.selenium.dev/blog/2024/chrome-browser-woes/ If the proposed solution works, can we close this?
Hello @aguspe, no.
Look at screenshots.
After I add argument (see my above reply) it starts working again. So it starts to happening without developers intervention and dev. can do nothing to solve it. ... it is caused probably by EU rules which Google must follow ... I guess. Maybe in your country this "choose search engine screen" does not appear.
I'm also in the EU and I can see this browser selection screen but that comes from google itself not selenium, so as @pujagani if after adding the flag to disable the search eangine selection works, the issue doesn't seem to be selenium related but chrome related
I can try to reproduce it again, but I can't, for more information:
https://www.ghacks.net/2023/12/09/google-chrome-to-display-choose-your-search-engine-prompt/
And as @pujagani refer already the blog regarding passing the flag
Just as an example @Pepan, the following code throws an error:
# test_example.rb
require 'minitest/autorun'
require 'selenium-webdriver'
class ExampleTest < Minitest::Test
def setup
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--window-size=1400,1400') # Set the window size
@driver = Selenium::WebDriver.for :chrome, options: options
end
def teardown
@driver.quit
end
def test_visiting_example_page
@driver.navigate.to 'https://google.com'
search_bar = @driver.find_element(xpath: '//*[@title="Search"]')
search_bar.send_keys 'Dogs'
assert_equal 'Dogs', @driver.title, 'Page title should have dogs'
end
end
Without me passing the flag '--disable-search-engine-choice-screen'
because it cannot interact with the element due to the default engine selection being in front of it, so it's not a Selenium issue but an issue due to this new selector in Chrome
I understand ... but it halted on selenium/webdriver/remote/response.rb:62:in
add_cause'` so I posted it here.
Thank you so much @Pepan have a great day!
What happened?
Error happened :
How can we reproduce the issue?
Relevant log output