profile.assume_untrusted_certificate_issuer = false不适合我

时间:2012-08-28 14:19:23

标签: ruby selenium webdriver watir watir-webdriver

使用watir-webdriver进行自动化我无法处理Firefox“Untrusted Connection”。已经尝试过这个:

 require 'watir-webdriver'
 profile = Selenium::WebDriver::Firefox::Profile.new
 profile.assume_untrusted_certificate_issuer = false
 browser = Watir::Browser.new(:firefox, :profile => profile)
 browser.goto("http://xxx.xxx.xxx.com)

仍然得到相同的结果?任何帮助将不胜感激......

2 个答案:

答案 0 :(得分:1)

这对我有用:

   @profile=Selenium::WebDriver::Firefox::Profile.from_name "default"
   @profile.assume_untrusted_certificate_issuer=false
   @profile.secure_ssl = true 
   browser = Watir::Browser.new :firefox, :profile => @profile

答案 1 :(得分:0)

能力帮助我:

capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(accept_insecure_certs: true)
$driver = Selenium::WebDriver.for :firefox, desired_capabilities: capabilities

geckodriver 0.14.0,Mozilla Firefox 52.0,selenium-webdriver 3.2.1