0

使用 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)

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

4

2 回答 2

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
于 2012-08-29T12:20:11.413 回答
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

于 2017-03-15T13:38:46.783 回答