无法隐藏“Chrome 正在被自动化软件控制"Chrome v76 中的信息栏 [英] Unable to hide "Chrome is being controlled by automated software" infobar within Chrome v76

查看:46
本文介绍了无法隐藏“Chrome 正在被自动化软件控制"Chrome v76 中的信息栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将 Chrome 更新到版本 76 后,我不知道如何隐藏Chrome 正在由自动化软件控制..."通知覆盖页面上的某些控件.

ChromeDriver 的最新稳定版本确实是 76.0.3809.68.以下代码适用于 Chrome 75 和 ChromeDriver 74.

var options = new ChromeOptions();options.AddArgument("--test-type");options.AddArgument("--disable-extensions");options.AddArguments("disable-infobars");options.AddArguments("--disable-notifications");options.AddArguments("启用自动化");options.AddArguments("--disable-popup-blocking");options.AddArguments("开始最大化");var driver = new ChromeDriver(driverLocation, options, ScriptTimeout);

解决方案

截至 2019 年 8 月 1 日 - 您可以发送 excludeswitch - enable-automation 来隐藏消息.并禁用弹出禁用开发者模式扩展"集useAutomationExtension=false .参考

 "goog:chromeOptions": {excludeSwitches":[启用自动化"],useAutomationExtension":假}

在 C# 中:

禁用弹出禁用开发者模式扩展"和自动化信息栏消息.

options.AddExcludedArgument("enable-automation");options.AdditionalCapability("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 中添加以下功能

功能:{'浏览器名称':'铬',goog:chrome选项":{excludeSwitches":[启用自动化"],useAutomationExtension":假}},

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.

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);

解决方案

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

Tested on : Windows 10 Version 76.0.3809.87 (Official Build) (64-bit) ChromeDriver 76.0.3809.68

--enable-automation : Inform users that their browser is being controlled by an automated test Reference

     "goog:chromeOptions": {

        "excludeSwitches": [ "enable-automation" ],
        "useAutomationExtension": false
     }

In C# :

To disable pop up "Disable developer mode extensions" and automation info-bar message .

options.AddExcludedArgument("enable-automation");
options.AddAdditionalCapability("useAutomationExtension", false);

In JAVA :

options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
options.setExperimentalOption("useAutomationExtension", false);

In Python :

options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)

In Protractor :

Add below capabilities in conf.js/conf.ts

capabilities: {
    'browserName': 'chrome',
    "goog:chromeOptions": {
      "excludeSwitches": [ "enable-automation" ],
      "useAutomationExtension": false
   }
  },

这篇关于无法隐藏“Chrome 正在被自动化软件控制"Chrome v76 中的信息栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆