ISTQB Certified Software Test Engineer

Sunday, May 9, 2010

Handling https using selenium

If we have a invalid ssl certificate or expired certificate configured with your tomcat server,it is not possible for selenium-Rc to handle https request until we add new SSL certificate to our server conf.xml.

So i found a solution to handle this.

1.In selenium RC directory we will find selenium server directory.In that directory we wil find SSL in which we will find a valid certificate.

2.Create a keystore file to import this certificate into that keystore file using the command in ur command prompt.

keytool -genkey -alias aliasname -keyalg rsa -keysize 2048 -keystore keystorename

3.It will ask for a password then give the password which u like
4.Then it will ask u for the details ,enter the details and again reenter the password
5.So in present working directory u wil find a keystore file.
6.Inport the certificate given by seleniium into this keystore file using command
keytool -keystore test -keyalg "RSA" -import -trustcacerts -file cybervillai

7.Now change the server.xml keystore property in conf dir of u r tomcat to point the created keystore file.
8.Now restart the server,and hit the url,then it will show certificate error and when u r trying to install the certificate,it has to show the seleinums certificate.
9.Install this certificate and restart the browser.
10.New certificate will be installed and it has to show a valid certificate.
11.If it is showing mismatched certificate address then in IE tools>Advanced>>security>>Uncheck the windows mismatch checkbox
12.Restart the browser.
13.And start using seleniumRC

Any doubts feel free to contact me

No comments:

Post a Comment