Friday, June 8, 2012

Selenium: How to accept SSL certificates

When you run your selenium tests on any HTTPS url, things go wrong. We get certificate exception and test doesn't proceed. In firefox, the workaround for this problem is to create your own Firefox profile, with the specific certificate added on it manually and then start Selenium server with that firefox profile, but for Internet Explorer there is no such workaround.

However, we can resolve this issue by installing CyberVillains Certificate on Windows. We need to follow below steps to work Selenium with SSL.

1. Start selenium server with "-trustAllSSLCertificates" command
2. Use "*firefoxproxy" instead of "firefox" OR "*iexploreproxy" instead of "iexplore"
3. Install CyberVillains Certificate (selenium bundles a special certification authority (CA) certificate that is used to trust all the other SSL certificates.)

Installing CyberVillains Certificate
---------------------------------------
1. Extract selenium jar into a folder
2. Goto sslSupport diretory
3. Double click on cybervillainsCA.cer




No comments: