Java “如何压制”;协议处理程序";匿名\匿名浏览器的弹出窗口?

Java “如何压制”;协议处理程序";匿名\匿名浏览器的弹出窗口?,java,google-chrome,selenium,selenium-webdriver,Java,Google Chrome,Selenium,Selenium Webdriver,我正在mac和Ubto上运行自动化(使用cucumber、selenium web驱动程序、junit) 在自动化过程中,我单击具有非http协议的链接 出现“外部协议请求”弹出窗口 它会阻止我测试网页的其余部分 如何为所有chrome配置文件禁用此弹出窗口?甚至匿名\匿名chrome 我已尝试将“”添加到/Users/eladb/Library/Application Support/Google/Chrome/Local State文件中 protocol\u handler:{“排除的\

我正在mac和Ubto上运行自动化(使用cucumber、selenium web驱动程序、junit)

在自动化过程中,我单击具有非http协议的链接

出现“外部协议请求”弹出窗口

它会阻止我测试网页的其余部分

如何为所有chrome配置文件禁用此弹出窗口?甚至匿名\匿名chrome

我已尝试将“”添加到
/Users/eladb/Library/Application Support/Google/Chrome/Local State
文件中

protocol\u handler:{“排除的\u方案”:{“waze”:false,“mailto”:false,}

并尝试:

protocol\u handler:{“排除的\u方案”:{“waze”:真,“mailto”:假,}


但即使重新启动并运行测试后,仍会出现弹出窗口。

使用chrome选项创建驱动程序实例,如下所示:

ChromeOptions cChromeOptions = new ChromeOptions();   
cChromeOptions.addArguments("--test-type");
WebDriver _driver=new ChromeDriver("path_to_your_Chrom_Driver", cChromeOptions);

我尝试的“本地状态”文件也不起作用。有人指出了文件夹默认/首选项文件。在那里进行更改,它就会起作用。

请查看这是属于Windows的,但我希望仍然有用。您可以解释一下什么是
“--test type”
?它没有帮助。仍然显示“外部协议请求”Popup您能描述一下您对默认/首选项文件所做的更改吗?