使用Selenium进行自动化时,在Firefox中禁止SSL安全警告

Sri*_*nth 8 ssl https selenium automation

当使用Selenium进行自动化时,有没有办法抑制在HTTPS上访问网站时显示的警告?我遇到了"-trustAllSSLCertificates"选项,但我无法让它工作.我通过以下方式启动了Selenium服务器:

java -jar selenium-server.jar -trustAllSSLCertificates
Run Code Online (Sandbox Code Playgroud)

......但我仍然得到安全警告.我错过了其他一些步骤吗?

Sri*_*nth 6

刚刚开始工作了.这是如何做:

除了使用-trustAllSSLCertificates选项启动Selenium服务器之外,Selenium 正在启动的浏览器应配置为使用Selenium服务器作为其代理.

例如:如果Selenium服务器myselenium.mycompany.com在默认端口的主机上启动4444,则代理设置为myselenium.mycompany.com:4444.自动执行此操作的一种方法是创建Firefox配置文件并将代理配置到此地址和端口,并在启动Selenium服务器使用-firefoxProfileTemplate选项时将此创建的配置文件作为参数传递.

java -jar selenium-server.jar -trustAllSSLCertificates -firefoxProfileTemplate /path/to/selenium_profile
Run Code Online (Sandbox Code Playgroud)