Skip to content
CodeKruPro

Open a test site with an invalid SSL certificate (Java)

QuizMediumJava onlyAsked in: Infosys

The QA environment uses a self-signed certificate (a certificate the site made for itself, so browsers do not trust it), so Chrome shows a privacy error page. How do you let the test continue in Selenium Java?

  • options.setAcceptInsecureCerts(true); on the ChromeOptions before starting the driver
  • Click "Advanced" and "Proceed" on the error page in every test
  • Turn off SSL for the whole machine
  • Use http instead of https in the test

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in