HTTPS Untrusted Certification Handling by selenium


Virtual Page From FIRE FOX







                            

                      some of you might have seen this kind of page when you try to load any web page. These page indicate that the certificate of your site is expired or not valid. Or might be the other reason like web site contains some harmful content…

So it’s a notification provided by browser.
It’s a screen shot of Fire Fox. Error page is differ for different browser

So if you try to automate this kind of page it is difficult because this page is a virtual page so you cannot automate   this page ……
Even selenium is also not able to record this page.

Solution in Firefox

Create a fire fox profile and load that profile whenever you try to automate your application

Window to create profile in FF

Follow below steps to create profile in Firefox
1)      Go to start menu
2)      Click on run
3)      Type firefox.exe –ProfileManager –no –remote 
4)      It will show you above  window click on 'create profile'
5)      Give the name to your profile and store it in to your file system
6)      Now start the newly created profile 


Steps to handle certification error with newly created profile 
1) Start the new profile (Type firefox.exe –ProfileManager –no –remote in CMD)
2) Load the same URL which prompt you that certification error 
3) Click on 'I understand the risk'


4) Click on 'Add Exception'



5) Click on 'Get Certificate'
6) Make sure “Permanently store this exception” is checked (it is by default)
7) Click on 'Confirm Security Exception'


So now next time whenever you load that URL it will not show you that certification problem

How to load FireFox profile using Selenium RC

Go to Start à RUN

Type CMD and press enter

Now reach to the path where your java client resides 


Type this command
Java –jar selenium-sever.jar –firefoxProfileTemplate D:\  (path of your profile)

Now Next time it won’t show you that certification error

Solution for IE
To handle this error you need to do some changes in registry

Next PostNewer Post Previous PostOlder Post Home