8

Is there a way to suppress the warning displayed when accessing sites on HTTPS when using Selenium for automation? I came across the option "-trustAllSSLCertificates", but I wasn't able to get it working. I started my Selenium server the following way:

java -jar selenium-server.jar -trustAllSSLCertificates

... but I still got the security warning. Am I missing some other steps?

Srikanth
  • 11,780
  • 23
  • 72
  • 92
  • I think this is what you're looking for: http://stackoverflow.com/questions/12082052/how-can-i-get-webdriver-to-dismiss-a-firefox-security-alert – Alex Feb 04 '13 at 18:12

3 Answers3

6

Just got it working. Here's how:

In addition to starting the Selenium server with -trustAllSSLCertificates option, the browser that is being launched by Selenium should be configured to use the Selenium server as its proxy.

For example: If Selenium server is started at host myselenium.mycompany.com at the default port 4444, the proxy setting is myselenium.mycompany.com:4444. One way to do automate this is to create a Firefox profile and configure the proxy to this address and port, and pass this created profile as an argument when starting the Selenium server using -firefoxProfileTemplate option.

java -jar selenium-server.jar -trustAllSSLCertificates -firefoxProfileTemplate /path/to/selenium_profile
Srikanth
  • 11,780
  • 23
  • 72
  • 92
  • Do have any idea how to deal the same problem in IE with PHP I have searched lot regarding this please help. – lAH2iV Sep 08 '11 at 09:26
4

Use Selenium RC Server 2.X (means version 2+), and run the command

java -jar selenium-server-standalone-2.X.X.jar -trustAllSSLCertificates

It is For sure working

0

I was looking for a programmatic way to do that and I got a nice way to do that which fits perfectly into my automation framework. Here is what I do:

//==========Create a RC Configuratoion object and Set trust all SSL certs to true==========

RemoteControlConfiguration rcc = new RemoteControlConfiguration();  
rcc.setTrustAllSSLCertificates(true);

//====Create a SeleniumServer object using the configuration=====================
SeleniumServer serv = new SeleniumServer(rcc);  
serv.start
user
  • 86,916
  • 18
  • 197
  • 190
Sameer
  • 1