2

For context I'm running ruby-rspec with selenium and capybara. When I navigate to the app_host I'm getting an InsecureCertificateError in the browser. How do I load a profile into selenium so that it will ignore the untrusted certificates? Below is what I'm currently trying to work with...

Capybara.register_driver :selenium do |app|
  profile = Selenium::WebDriver::Firefox::Profile.new
  profile.assume_untrusted_certificate_issuer=false
  Capybara::Selenium::Driver.new(app, browser: :firefox, profile: profile)
end
Zack
  • 2,377
  • 4
  • 25
  • 51

1 Answers1

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

see selenium docs

Eric Himmelreich
  • 407
  • 4
  • 13
  • Eric this gives me a `uninitialized constant Selenium::WebDriver::Firefox::Remote` – Zack Mar 27 '18 at 20:48
  • @Zack That's because it should be either of Selenium::WebDriver::Remote::Capabilities.firefox(accept_insecure_certs: true) or more likely `Selenium::WebDriver::Remote::W3C::Capabilities.firefox(accept_insecure_certs: true)` - The selenium docs are wrong, or haven't been updated to match the current class structure in selenium-webdriver – Thomas Walpole Mar 27 '18 at 22:41