Home > other >  Watir: ignore invalid Browser certificates
Watir: ignore invalid Browser certificates

Time:10-10

I'm trying to tell Google Chrome to ignore invalid Browser certificates with the command line switch from official documentation [1]:

Watir::Browser.new :chrome, switches: ['--ignore-certificate-errors']

But I get the error:

ArgumentError: {:switches=>["--ignore-certificate-errors"]} are unrecognized arguments for Browser constructor from /var/lib/gems/3.0.0/gems/watir-7.1.0/lib/watir/capabilities.rb:79:in `process_browser_options' 3.0.2 (dev)[1] »

How can I get rid of the error and tell Chrome to ignore the certificate?

[1] http://watir.com/guides/certificates/

CodePudding user response:

Switches get passed on the args parameter:

Watir::Browser.new(:chrome, options: {
  args: ['--ignore-certificate-errors']
})
  • Related