How to Handle Untrusted Certificate Selenium Webdriver

Hello, Welcome to Selenium tutorial in this post we will see how to Handle Untrusted Certificate Selenium.

 

  • What is Untrusted SSL certificate? Whenever We try to access HTTPS website or application so many time you will face  untrusted SSL certificate issue. This issue comes in all browser like IE, Chrome,Safari, Firefox etc.

Handle Untrusted Certificate Selenium

2-       Why we get this certificate issues often?

 

Handle Untrusted Certificate Selenium

This certificates some in multiple conditions and we should know all of them so that we can rectify them easily.

1- Each secure site has Certificate so its certificate is not valid up-to-date.

2– Certificate has been expired on date

3– Certificate is only valid for (site name) 


4- 
The certificate is not trusted because the issuer certificate is unknown due to many reasons.

 

Handle Untrusted Certificate Selenium

Step 1-We have to create FirefoxProfile in Selenium.

Step 2- We have some predefined method in Selenium called setAcceptUntrustedCertificates() which accept Boolean values(true/false)- so we will make it true.

Step 3-Open Firefox browser with the above-created profile.

 

I have published video on the same.

 

Handle untrusted certificate in Firefox

 

 

Since Firefox comes default browser in Selenium so for other browsers like Chrome, IE, Safari we have to use below technique.

Handle untrusted certificate in Chrome

 

Handle untrusted certificate in IE

  Handle untrusted certificate in Safari

I would suggest you add above code in Base Class in Selenium Webdriver so you don’t have to write code again and again.

I have implemented in my office project and found good results.

Thanks for visiting my blog. Please comment below if you finding any issue.

Keep in touch. Have a nice day :)

35 Comments

  1. Sanjay
  2. Bhavik
  3. Venu Yalluri
  4. Venu Yalluri
  5. Sreenath
  6. swapna
  7. Jithendra Reddy K
  8. Vishnu Godse
  9. Prachee Jain
  10. Prachee Jain
      • Richmond
          • Richmond
  11. Vidya
  12. BG
  13. Raja
  14. Lajish Lakshmanan
      • Lajish Lakshmanan

Leave a Reply