如何停止chrome的选择证书窗口 [英] How to stop chrome's Select a certificate window
问题描述
我正在开展一个硒项目,我需要测试的系统是使用SSL证书。每次尝试登录时,我们都会得到这个选择证书窗口。我们无法使用webdriver处理。
我已经尝试点击使用AutoItx的确定按钮,如下所示。但是发送({ENTER})
不是最好的选择。
if(AutoItX.WinWaitActive(data :, - Google Chrome,,10)== 0)
{
AutoItX.WinActivate(data :, Google Chrome );
AutoItX.Send({ENTER});
}
有没有一种方法可以使用并使用autoItx点击OK按钮。或者有什么办法可以在使用Capabilities定义chromedriver时加载这个证书。
赞赏任何想法来解决这个问题。
创建注册表键:
HKEY_LOCAL_MACHINE \SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls
这里用名称创建新的字符串值(REG_SZ) 1
随着数值数据输入:
{pattern:[*。],filter:{}}
这就是注册表的样子。 有关此密钥的更多信息,我发现: 值必须是字符串化的JSON字典数组。每个字典必须具有{pattern格式:$ URL_PATTERN,filter:$ FILTER},其中$ URL_PATTERN是内容设置模式。 $ FILTER限制浏览器自动选择哪个客户端证书。独立于筛选器,只会选择与服务器的证书请求匹配的证书。如果$ FILTER的格式为{ISSUER:{CN:$ ISSUER_CN}},另外只选择由CommonName $ ISSUER_CN颁发的证书。如果$ FILTER是空字典{},那么客户端证书的选择不会受到额外的限制。 I'm working on a selenium project, and the system I need to test is using SSL certificate. Every time when try to login the we are getting this "Select a certificate" window. Which we cannot handle with webdriver. I have tried click on ok button using AutoItx as below. But the Is there a way to use and click on OK button using autoItx. Or is there a way we can load this certificate when defining chromedriver by using Capabilities. Appreciate any ideas to solve this issue. This helped on Chrome Version 59.0.3071.86 (64-Bit), Win 7 Enterprise: Create registry key: Here create new String value (REG_SZ) with name 1 As Value data enter: This is how the registry then looks like. For more information on this key I found: The value must be an array of stringified JSON dictionaries. Each dictionary must have the form { "pattern": "$URL_PATTERN", "filter" : $FILTER }, where $URL_PATTERN is a content setting pattern. $FILTER restricts from which client certificates the browser will automatically select. Independent of the filter, only certificates will be selected that match the server's certificate request. If $FILTER has the form { "ISSUER": { "CN": "$ISSUER_CN" } }, additionally only client certificates are selected that are issued by a certificate with the CommonName $ISSUER_CN. If $FILTER is the empty dictionary {}, the selection of client certificates is not additionally restricted. on Automatically select client certificates for these sites 这篇关于如何停止chrome的选择证书窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
Send("{ENTER}")
is not the best option continue with.if (AutoItX.WinWaitActive("data:, - Google Chrome", "", 10) == 0)
{
AutoItX.WinActivate("data:, - Google Chrome");
AutoItX.Send("{ENTER}");
}
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls
{"pattern":"[*.]","filter":{}}