1

I'm having a very odd issue with some capybara/selenium tests. For context I'm running ruby-rspec with selenium and capybara. My test work just fine when I run them on Chrome, but for some reason with Firefox, the 2nd URL fails.

spec_helper.rb

BROWSER = :chrome
BROWSER = :firefox

Capybara.register_driver :selenium do |app|
  Capybara::Selenium::Driver.new(app, browser: BROWSER)
end

Capybara.default_driver = :selenium
# This one works
Capybara.app_host = "https://bar.foo.com/home"
# This one doesn't
Capybara.app_host = "https://foo.bar.com:18661/home"

The error I get:

Selenium::WebDriver::Error::WebDriverError: 
WebDriverError@chrome://marionette/content/error.js:172:5
InsecureCertificateError@chrome://marionette/content/error.js:291:5
handleReadyState@chrome://marionette/content/listener.js:274:21
handleEvent@chrome://marionette/content/listener.js:247:9
Zack
  • 2,377
  • 4
  • 25
  • 51
  • 1
    what happens if you manually navigate to that url with the port specified? the error is indicating an InsecureCertificateError, so it's probably Firefox being a bit more picky about certificates? – Breaks Software Mar 27 '18 at 18:09
  • @BreaksSoftware you hit the nail on the head... It prompted me with a security error. I was able to add an exception, but how do I make that translate over the when the selenium test run? – Zack Mar 27 '18 at 18:12
  • You can check the accepted answer [here](https://stackoverflow.com/questions/37868425/accept-ssl-cert-with-marionette-firefox-webdrive-python-splinter#41711649). I think it may help you. – JollyProgrammer Mar 27 '18 at 18:44
  • @JollyProgrammer appreciate the help, sadly that is for Python. I'm in Ruby. – Zack Mar 27 '18 at 18:48

0 Answers0