十五年测试老手,长期负责WEB\APP 项目测试,目前主要负责团队管理工作。
selenium webdriver测时ssl安全验证
上一篇 /
下一篇 2012-10-21 20:49:34
/ 个人分类:webdriver
~Tg+qsy!_0最近在用webdriver测试https://时,火狐总是报安全问题。而在选项中将被测网址加入信任网址也没用。
Oa~/^~W.]4{051Testing软件测试网W@VL%DiFk4R最后在一个国外论坛找到了解决办法。https://gist.github.com/1179537
*nX5b:X3C
M!R"]
f
Oj0o-Ab,{BGe'S.B#e0一般情况下我们的代码为:51Testing软件测试网;~K8\6n"Z3r4F
51Testing软件测试网xZ(cMX qnbrowser=webdriver.Firefox()51Testing软件测试网$BMB-oOLQ
51Testing软件测试网KQ `U(j*k1yaq"?要绕过安全验证则如下:51Testing软件测试网8fDpU7O5|2];y
51Testing软件测试网9E$RD6ay+uO7dfromseleniumimport webdriver
*\,d.hl&y&fZ0profile = webdriver.FirefoxProfile()51Testing软件测试网
T-E)u'H q vg$m?he
profile.default_preferences["webdriver_assume_untrusted_issuer"]= 'false'51Testing软件测试网%G3OV|C^E
profile.update_preferences()51Testing软件测试网6w K k)c&l4O-o0H
browser=webdriver.Firefox(profile)51Testing软件测试网+Es:j&|AD[:S
收藏
举报
TAG: