How do I use certificate-based authentication with WATIR-WebDriver?
I've been using ruby Mechanize for several years to do automated testing of the SaaS product we host. The site is using JS more and more, making maintenance of the Mechanize scripts nearly impossible. I've decided to try 开发者_Python百科using WATIR-WebDriver instead. However, the login process requires a user certificate and password. I can't find any reference to using a cert like this.
If you're using Chrome, you can ignore certificate errors by passing an command line option to the Chrome Driver:
b = Watir::Browser.new :chrome, :switches => ['--ignore-certificate-errors']
If you're using Firefox, try
profile = Selenium::WebDriver::Firefox::Profile.new
profile.assume_untrusted_certificate_issuer = true
b = Watir::Browser.new WEB_DRIVER, :profile => profile
精彩评论