Watir: 应用Watir-Webdriver 访问需要证书的网站情况

#Suppose we will access an SVN net
require 'watir-webdriver'
b = Watir::Browser.new :chrome
b.goto 'https://admin:password@yourwebsite.com'

#Firefox Deal with Certification:
profile = Selenium::WebDriver::Firefox::Profile.new 
profile.assume_untrusted_certificate_issuer = false
b = Watir::Browser.new :firefox, :profile => profile

#Chrome Deal with Certification:
Watir::Browser.new :chrome, :switches => ['--ignore-certificate-errors']

 

posted @ 2013-08-16 16:51  chenpassion  阅读(267)  评论(0编辑  收藏  举报