selenium测试SSL的证书问题

上一篇 / 下一篇  2009-02-01 14:30:27 / 个人分类:selenium

参考文章链接:http://hi.baidu.com/bluetcw/blog/item/be5c1534b272323f5ab5f500.html

        http://www.51testing.com/?111742/action_viewspace_itemid_103239.html

使用FF测试SSL

1)       下载firefox插件FF2.0remember_mismatched_domains; FF3.0remember cetificates exception

   下载地址:FF2.0https://addons.mozilla.org/en-US/firefox/addon/2131

  FF3.0https://addons.mozilla.org/en-US/firefox/addon/10246

 

2)       复制FFcustomProfile到脚本目录下;

       文件位置:C:\DocumentsandSettings\Administrator\ApplicationData\Mozilla\Firefox\Profiles\nvvxu5e6.default

(文件名不一定为nvvxu5e6.default,但一定以.default结尾)

 

3)       Cmd中运行命令:java -jar selenium-server.jar-multiwindow -firefoxProfileTemplate "nvvxu5e6.default"

 

4)selenium = new DefaultSelenium("localhost", 4444, "*chrome",url);

 

使用IE测试SSL:(当然首先要把*chrome改成*iehta
1.
安装上cybervillainsCA.cer,($HOME\selenium-server-0.9.2\sslSupport,确定这个证书被importthe Trusted Root certification Authorities

2. IE Browser -> Tools -> InternetOptions ->Advaceduncheck两个选项

   1) check the publisher's certificate revocation.(检查发行商证书的吊销)

   2) Warn about certificate address mismatch(对无效站点证书发出警告)

然后重启IE,再执行selenium脚本,那个烦人的security alert警告对话框就不会再烦人了。这样做有安全隐患,建议在虚拟机里执行,或者,执行完测试脚本后将IE恢复修改前的设置。

 


TAG: SSL Selenium selenium

 

评分:0

我来说两句

Open Toolbar