Not able to hide chrome is being controlled by automated test software

183 views
Skip to first unread message

garvitag...@gmail.com

unread,
Mar 11, 2021, 11:13:31 PM3/11/21
to Selenium Users
Hi,

I am using selenium with serenity BDD. Chrome and chrome driver version is 88. I need to hide this message. I tried below but did not work :

options.setExperimentalOption("useAutomationExtension", false);
options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"});

Here is complete code :
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
options.addArguments("enable-automation");
options.addArguments("ignore-certificate-errors");
options.addArguments("disable-popup-blocking");
options.addArguments("disable-infobars");
options.setExperimentalOption("useAutomationExtension", false);
options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"});
Proxy proxy = new Proxy();
proxy.setHttpProxy("proxy url");
options.setCapability("proxy", proxy);
options.setCapability(ChromeOptions.CAPABILITY, options);
driver = new ChromeDriver(options);

Thanks !!

Arvind Sah

unread,
Mar 12, 2021, 12:33:59 PM3/12/21
to seleniu...@googlegroups.com
This works for me - 

System.setProperty("webdriver.chrome.silentOutput", "true");
co = new ChromeOptions();

//set the download path and disable save as modal window
HashMap<String, Object> chromePrefs = new HashMap<String, Object>();
chromePrefs.put("profile.default_content_settings.popups", 0);
chromePrefs.put("download.default_directory", downloadFilepath);
chromePrefs.put("download.prompt_for_download", "false");
chromePrefs.put("profile.default_content_setting_values.geolocation", 2);
co.setExperimentalOption("prefs", chromePrefs);

co.addArguments("--disable-notifications", "--disable-gpu", "--no-sandbox", "--disable-dev-shm-usage");
co.addArguments("--disable-geolocation");

co.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
co.setExperimentalOption("useAutomationExtension", false);
co.addArguments("--start-maximized");

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2ce32475-5957-407f-a297-dadda7cfa530n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages