本文介绍了使用 WebDriver 处理 UntrustedSSLcertificates的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 Java 中使用 Web 驱动程序处理 UntrustedSSLcertificates 时遇到了困难.
I got stuck in handling UntrustedSSLcertificates using web driver in Java.
我创建的 Firefox 配置文件如下:
I created firefox profile like:
FirefoxProfile profile = new FirefoxProfile(); profile.setAcceptUntrustedCertificates(true); profile.setAssumeUntrustedCertificateIssuer(false);我创建了 Firefox 配置文件,添加了覆盖的证书.
I created firefox profile, added overridden certificate.
这不是处理 SSL 证书.
This is not handling SSL certificates.
还有其他方法可以处理 UntrustedSSL 证书吗?
Is there any other way to handle UntrustedSSLcertificates?
推荐答案最终我找到了 Untrusted SSLCertificates 的解决方案:
Eventually I found solution for Untrusted SSLCertificates:
ProfilesIni allProfiles = new ProfilesIni(); System.setProperty("webdriver.firefox.profile","your custom firefox profile name"); String browserProfile = stem.getProperty("webdriver.firefox.profile"); FirefoxProfile profile = allProfiles.getProfile(browserProfile); profile.setAcceptUntrustedCertificates (true); webdriver = new FirefoxDriver(profile);更多推荐
使用 WebDriver 处理 UntrustedSSLcertificates
发布评论