无法隐藏"Chrome正在由自动化软件控制" Chrome v76中的信息栏 [英] Unable to hide "Chrome is being controlled by automated software" infobar within Chrome v76
问题描述
将Chrome更新到版本76后,我无法弄清楚如何隐藏"Chrome正在由自动化软件控制..."通知,从而覆盖页面上的某些控件.
After updating Chrome to version 76, I cannot figure out how to hide the "Chrome is being controlled by automated software..." notification overriding some controls on the page.
ChromeDriver的最新稳定版确实是76.0.3809.68. 以下代码适用于Chrome 75和ChromeDriver 74.
The latest stable release of ChromeDriver is indeed 76.0.3809.68. The following code worked with Chrome 75 and ChromeDriver 74.
var options = new ChromeOptions();
options.AddArgument("--test-type");
options.AddArgument("--disable-extensions");
options.AddArguments("disable-infobars");
options.AddArguments("--disable-notifications");
options.AddArguments("enable-automation");
options.AddArguments("--disable-popup-blocking");
options.AddArguments("start-maximized");
var driver = new ChromeDriver(driverLocation, options, ScriptTimeout);
推荐答案
自2019年8月1日起-您可以发送excludeswitch-enable-automation隐藏消息.并禁用弹出式菜单禁用开发人员模式扩展" useAutomationExtension = false. 请参考useAutomationExtension
As of 1 Aug 2019 - You can send the excludeswitch - enable-automation to hide the message. and to disable pop up 'Disable developer mode extensions' set useAutomationExtension=false . Refer for useAutomationExtension
经过以下测试:Windows 10 版本76.0.3809.87(官方内部版本)(64位) ChromeDriver 76.0.3809.68
Tested on : Windows 10 Version 76.0.3809.87 (Official Build) (64-bit) ChromeDriver 76.0.3809.68
-enable-automation:通知用户其浏览器正在由自动测试控制参考
--enable-automation : Inform users that their browser is being controlled by an automated test Reference
"goog:chromeOptions": {
"excludeSwitches": [ "enable-automation" ],
"useAutomationExtension": false
}
在C#中:
要禁用弹出的禁用开发人员模式扩展"和自动化信息栏消息.
To disable pop up "Disable developer mode extensions" and automation info-bar message .
options.AddExcludedArgument("enable-automation");
options.AddAdditionalCapability("useAutomationExtension", false);
在JAVA中:
options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
options.setExperimentalOption("useAutomationExtension", false);
在Python中:
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
在量角器中:
在conf.js/conf.ts中添加以下功能
Add below capabilities in conf.js/conf.ts
capabilities: {
'browserName': 'chrome',
"goog:chromeOptions": {
"excludeSwitches": [ "enable-automation" ],
"useAutomationExtension": false
}
},
这篇关于无法隐藏"Chrome正在由自动化软件控制" Chrome v76中的信息栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!