ChromeDriver - 在Selenium WebDriver自动化上弹出禁用开发者模式扩展 [英] ChromeDriver - Disable developer mode extensions pop up on Selenium WebDriver automation

查看:808
本文介绍了ChromeDriver - 在Selenium WebDriver自动化上弹出禁用开发者模式扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下问题:
当我运行自动化测试时,我会在Chrome中收到以下警告禁用开发者模式扩展。

I'm having the following issue: When I'm running my automation tests, I keep getting the following alert "Disable Developer Mode Extension" in Chrome.

是有办法删除/禁用此功能吗?这对我来说是一个阻碍,因为它让我失败了一些测试。

Is there a way to remove/disable this?. It is a blocker for me as it is making me fail some tests.

提前致谢

推荐答案

您是否尝试使用命令行参数禁用开发人员扩展?

Did you try disabling the developer extensions with command line param?

尝试使用以下Selenium WebDriver java代码:

Try with the following Selenium WebDriver java code:

System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-extensions");
driver = new ChromeDriver(options);

这篇关于ChromeDriver - 在Selenium WebDriver自动化上弹出禁用开发者模式扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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