What are the ways to handle self signed certificate error in IE8 using Selenium Webdriver + Java?
-
I am literally stuck to this problem for two days now. Scenario: The website that needs to be tested has a self signed certificate. So Internet Explorer (8 in windows XP_ shows "The security certificate presented by this website was not issued by a trusted certificate authority. The security certificate presented by this website was issued for a different website's address." Now this is perfectly natural in case of IE8 and self-signing certificates so I took the following measures to no use Manually added/installed the certificate as a Trusted Root Certificate in IE. But it doesn't get shown in the list, but it gets successfully added to all other tabs i.e. trusted root publisher,Intermediate Publisher Authority,Other People. The same certificate gets added to firefox without any problems under "servers" and works just as expected. I tried using the following codes but one of them worked for selenium Proxy proxy = new Proxy(); proxy.setProxyType(ProxyType.MANUAL); Proxy.setSslProxy("trustAllSSLCertificates"); DesiredCapabilities capabilities1 = DesiredCapabilities.internetExplorer(); capabilities1.setCapability(CapabilityType.PROXY, proxy); When this doesn't work I tried using DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); I have the cybervillans certificate already installed. I have tried the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_ERROR_PAGE_BYPASS_ZONE_CHECK_FOR_HTTPS_KB954312 method knowing full well it is for win7. 5.I have even tried changing the URL to the issued authority but even then the problem persists. And now I am stuck with no alternatives. Can anyone point it out to me how I can proceed? It seems I'm eternally stuck with IE8. I have searched a lot in Google as well as in this site. But couldn't find a solution to my problem.
-
Answer:
I wrote up an article of how to do this with Selenium RC: http://blog.mogotest.com/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium/ While not directly applicable, the general concepts are the same. Rather than use the Selenium Server as the proxy server, however, you should use the BrowserMob Proxy: http://opensource.webmetrics.com/browsermob-proxy/ Basically, you instruct Windows / IE to trust the CyberVillains cert. IE connects to the BrowserMob Proxy and that proxy signs all SSL traffic using the CyberVillains cert. I really should get a Selenium WebDriver article up on how to do this. But that should get you going.
Kevin Menard at Quora Visit the source
Other answers
Try this. Proxy proxy = new Proxy(); proxy.setProxyType(ProxyType.MANUAL); Proxy.setSslProxy("trustAllSSLCertificates"); DesiredCapabilities capabilities1 = DesiredCapabilities.internetExplorer(); capabilities1.setCapability(CapabilityType.PROXY, proxy); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
Nareshkumar Regala
I have tried my hand in accepting SSL certificate for all three browser by using DesiredCapabilites To read more you may visit http://abodeqa.wordpress.com/2013/05/03/accepting-untrusted-ssl-certificate-in-webdriver-for-chrome-and-firefox-browser/ Hope fully it would help you...if you like this post then don't forget to follow this blog for future update about coming posts
Dwarika Dhish Mishra
Related Q & A:
- How to handle a popup in selenium webdriver?Best solution by Stack Overflow
- What are some ways to make extra money while in college?Best solution by Yahoo! Answers
- What are some ways to make money?Best solution by Yahoo! Answers
- What does certificate error navigation blocked mean?Best solution by Yahoo! Answers
- How to add self-signed certificates to different browsers?Best solution by Super User
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.