如何使用Selenium [在Python中]导入Firefox的SSL证书?

尝试使用Python WebDriver和FirefoxProfile找到一种使用Selenium在Firefox中安装特定SSL证书的方法.我们需要使用我们自己的自定义证书,该证书存储在运行WebDriver的计算机中,因此理想的解决方案如下所示:

profile = get_my_profile()
profile.importCertificate('/my/certificates/my_cert.cert')
driver = new webdriver.Firefox(profile=profile)

我怎样才能做到这一点?

非常感谢!

解决方法:

From this answer

Webdriver has no built in mechanism for adding a personal cert.

If you are using firefox the only way that I have found to do this is
to create a firefox profile and add the certificate to it. You can
then either reuse the profile when you run your tests OR, and this is
my prefered option, take the cert8.db and key3.db files and add them
to the profile that webdriver creates at runtime. – 07001

虽然下一个答案提供了workaround.

相关文章

转载地址:https://www.cnblogs.com/mini-monkey/p/12104821...
web自动化测试过程中页面截图相对比较简单,可以直接使用sel...
目录前言一、Selenium简介二、浏览器驱动1.浏览器驱动参考2....
一、iframe的含义:iframe是HTML中框架的一种形式,在对界面...
转载请注明出处❤️作者:测试蔡坨坨原文链接:caituotuo.to...
'''##**认识selenium**​**下载:pipinstall...