Tuesday, October 18, 2011

Run https site with Selenium, C#.Net and Firefox 3.5.3

1) Open the Windows "Start" menu, select "Run", then type and enter one of the following:

firefox.exe -profilemanager

2) Create a new profile (e.g. selenium-https-profile) and work with this profile.

3) Open your application manually and accept the certificate permanently with the newly created profile (i.e. selenium-https-profile) and hit the ok button.

4) Run the Selenium RC server with -firefoxProfileTemplate option and specify the path.

java -jar selenium-server.jar –firefoxProfileTemplate "C:\Users\\AppData\Roaming\Mozilla\Firefox\Profiles\gmkxzvfb.selenium-https-profile"

5) Go to SetupTest() function in your designed C# Code and Start Selenium server with following code:

selenium = new DefaultSelenium("localhost", 4444, "*firefox", "https://www.xxx.com/");

6) Run The Test from C#.NET.

Run https site with Selenium, C#.Net and IE 8.0

1) Open IE.

2) Go to Tools->Internet Options->Content->Certificate->Trusted Root Certificate Authorized and Import new Certificate (i.e. cybervillainsCA) from “\selenium-remote-control-1.0.1\selenium-server-1.0.1\sslSupport “

3) Start selenium server with the Following command:

:\selenium-remote-control-1.0.1\selenium-server-1.0.1>java -jar Selenium-server.jar -interactive –trustAllSSLCertificates

4) Go to SetupTest() function in your designed C# Code and Start Selenium server with following code:

selenium = new DefaultSelenium("localhost", 4444, "*piiexplore", "https://xxx.com/);

5) Run The Test from C#.NET.