如何处理硒网格中的不可信连接错误
我正在测试一个网站,该网站根据其配置文件同时使用 http 和 https 协议。
我正在用 java 编写测试用例。 我的测试用例对于 http 工作正常,但在 https 中它会生成不受信任的连接错误。 我知道我可以使用 firefoxprofile manager 来避免这种情况,但问题是我的测试用例将在许多计算机上使用来测试该网站,并且不可能在每台计算机上创建配置文件 有什么方法可以避免出现此错误,以便我的测试用例完美适用于 http 和 https。
I am testing a web site which uses both http and https protocols depending on its configuration file.
I am writing my test cases in java.
My test cases are working fine for http but in https it generates a untrusted connection error.
I know i can avoid this using firefoxprofile manager but problem is that my test cases will be used on many machines to test this website and creating a profile on every machine is not possible
Is there any way to avoid getting this error so that my test cases works perfectly for both http and https.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试使用
-trustAllSSLCertificates
子句调用浏览器。这是一个代码片段:
You could try invoking the browser with
-trustAllSSLCertificates
clause.Here's a code snippet:
rs79 的答案是一个好的开始,但根据您的浏览器,您需要采取更多步骤。我写了一篇关于在 Selenium 中测试 SSL 的非常全面的文章,您可能想查看一下:
http://mogotest.com/blog/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium
rs79's answer is a good start, but depending on your browser there are more steps you need to take. I wrote up a pretty comprehensive article on testing SSL in Selenium that you may want to check out:
http://mogotest.com/blog/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium