开发者

How do I use certificate-based authentication with WATIR-WebDriver?

开发者 https://www.devze.com 2023-03-16 07:41 出处:网络
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 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
0

精彩评论

暂无评论...
验证码 换一张
取 消