Hi all,
As many of you might have noticed, Chrome has been updated to v127, and for automation purposes when Opening Browser from scratch wit RF, a pop-up is now available to choose the search engine.
As Google often use (I guess) shadow-dom, this pop-up is not easily interactable, and even if it would I don’t plan to act on it at each startup.
Long story short, I didn’t found any argument to manage this window, so dug into the chrome profile and preferences files, keep only what’s required to validate this pop-up (100ko files), and use it as profile this way:
VAR ${profile_argument} --user-data-dir=${PROFILE_PATH}
${chrome_options} Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument ${profile_argument}
Call Method ${chrome_options} add_argument --disable-dev-shm-usage
Call Method ${chrome_options} add_argument --no-sandbox
Call Method ${chrome_options} add_argument --disable-logging
Call Method ${chrome_options} add_argument --log-level\=3
VAR ${url} myurl
Open Browser ${url} chrome options=${chrome_options}
This works, I stored the profile, copy it at startup, but if somebody has some other ideas or solution I’m ready
Thing here is that when using Docker locally each profile needs it’s own folder, and I’m not really into managing these files on a day or week basis, considering they might change a lot.
Thanks and regards
Charlie
3 Likes
The answer in StackOverflow probably should work
Just need to add this Chrome Options:
options.addArguments(“–disable-search-engine-choice-screen”);
5 Likes
Nice, thanks. Didn’t found this topic before. But I’ll try it and let you know.
Thanks again
Edit : yes that works!
3 Likes
Currently I am using this keyword and it works:
Open Browser ${URL} ${browser_selected} service_log_path=${{os.path.devnull}} options=add_experimental_option(“prefs”,${prefs}); add_experimental_option(“excludeSwitches”,${logging})
How should I add this “search engine block”? This one does not work:
Open Browser ${URL} ${browser_selected} service_log_path=${{os.path.devnull}} options=add_experimental_option(“prefs”,${prefs}); add_experimental_option(“excludeSwitches”,${logging}); add_experimental_option(“–disable-search-engine-choice-screen”)
This one fails:
Open Browser ${URL} ${browser_selected} options=options.addArguments(“–disable-search-engine-choice-screen”);
Suspended due to logged failure: ValueError: Unable to parse option: “options.addArguments(“–disable-search-engine-choice-screen”)”
This one worked:
Open Browser ${URL} ${browser_selected} options=add_argument(“disable-search-engine-choice-screen”)
2 Likes
Thank you for the solution
Hi,
I’m not using the options as you do directly in the line, but use it this way that works (it’s not an experimental one), creating the instance first then adding options:
${chrome_options} Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument --disable-search-engine-choice-screen
Call Method ${chrome_options} add_argument --disable-dev-shm-usage
Call Method ${chrome_options} add_argument --no-sandbox
Call Method ${chrome_options} add_argument --disable-logging
Call Method ${chrome_options} add_argument --log-level\=3
Open Browser ${url} chrome options=${chrome_options}
I was having trouble too, but @mrr_robot solution showed me that the argument does not have the initial dash. This is my step:
Open Browser ${juice_shop_local} ${BROWSER} options=add_argument("disable-search-engine-choice-screen");
4 Likes