在Firefox使用Selenium自动化时燮preSS SSL安全警告 [英] Suppress SSL security warning in Firefox when using Selenium for automation

查看:358
本文介绍了在Firefox使用Selenium自动化时燮preSS SSL安全警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法用晚餐preSS使用Selenium自动化访问时,对HTTPS站点时显示的警告?我碰到选项-trustAllSSLCertificates,但我无法得到它的工作。我开始了我的硒服务器按以下方式:

Is there a way to suppress the warning displayed when accessing sites on HTTPS when using Selenium for automation? I came across the option "-trustAllSSLCertificates", but I wasn't able to get it working. I started my Selenium server the following way:

java -jar selenium-server.jar -trustAllSSLCertificates

...但我还是得到了安全警告。我缺少一些其他的措施?

... but I still got the security warning. Am I missing some other steps?

推荐答案

刚刚得到它的工作。具体方法如下:

Just got it working. Here's how:

在除了开头 -trustAllSSLCertificates 选项,正在由硒推出应配置为使用硒服务器作为其代理的浏览器的Selenium服务器。

In addition to starting the Selenium server with -trustAllSSLCertificates option, the browser that is being launched by Selenium should be configured to use the Selenium server as its proxy.

例如:如果Selenium服务器在主机 myselenium.mycompany.com 启动时的默认端口 4444 ,代理服务器设置为 myselenium.mycompany.com:4444 。做自动化的一个方法是创建一个Firefox配置文件和配置代理到该地址和端口,并使用启动硒服务器时通过这个创建的配置文件作为参数 -firefoxProfileTemplate 选项。

For example: If Selenium server is started at host myselenium.mycompany.com at the default port 4444, the proxy setting is myselenium.mycompany.com:4444. One way to do automate this is to create a Firefox profile and configure the proxy to this address and port, and pass this created profile as an argument when starting the Selenium server using -firefoxProfileTemplate option.

java -jar selenium-server.jar -trustAllSSLCertificates -firefoxProfileTemplate /path/to/selenium_profile

这篇关于在Firefox使用Selenium自动化时燮preSS SSL安全警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆