WebdriverIO 如何在 Chrome 84 中禁用 "Save Password" 弹出窗口?

WebdriverIO How to DISABLE "Save Password" popup in Chrome 84?

我非常想找到这个解决方案,因为网上似乎没有任何东西在 atm 上工作。

我的 WDIO 依赖关系

"@wdio/browserstack-service": "^6.1.15",
"@wdio/cli": "^6.3.4",
"@wdio/cucumber-framework": "^6.3.0",
"@wdio/devtools-service": "^5.13.0",
"@wdio/local-runner": "^6.3.4",
"@wdio/spec-reporter": "^6.3.0",
"@wdio/sync": "^6.3.3",

基本上我需要禁用这个弹出窗口: https://imgur.com/a/51GZLtY

我在 chrome:

中禁用了一个参数

chrome://settings/passwords - Offer to save passwords

观察到的文件

AppData\Local\Google\Chrome\User Data\Default\Preferences

添加了 1 个首选项

"credentials_enable_service": false,

值得一提的是,我尝试了其他值:

"credentials_enable_service": "false"
"credentials_enable_service": 0
"credentials_enable_service": "0"
"credentials_enable_service": 1
"credentials_enable_service": "1"
"credentials_enable_service": 2
"credentials_enable_service": "2"

在我的能力范围内,我添加了以下内容:

"goog:chromeOptions": {
    "prefs": {
      "credentials_enable_service": false
    },
     "args": [some arguments]
  }

但弹出窗口仍然存在 在 WDIO 创建的 chrome 中,我可以看到 param

chrome://settings/passwords - Offer to save passwords - 启用

所以我的问题是 WebdriverIO 是否将 "goog:chromeOptions": { "prefs": {} } 传递给 Chrome 浏览器? 似乎prefs没有通过。至少我尝试了一种形式,因为 args 数组工作完美

有什么建议吗?

只需将 '--enable-automation' 添加到 args

干杯。

像这样更新功能在 Chrome 浏览器中工作正常

    capabilities: [{

        'goog:chromeOptions': { 
            args: ["--disable-gpu", "--enable-automation","--headless"]
       }
    }],