Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chromedriver in Selenium and SSL certificate

I am using Selenium to test a web site which has HTTP Auth and now even SSL certificate.

As workaround for HTTP Basic Authentification I am using ChromeDriver - http://code.google.com/p/selenium/wiki/ChromeDriver and opening URLs in format

https://username:[email protected]

But now from security reasons, Client certificate needs to be installed on PC in order to log into that application.

However, ChromeDriver cannot see the "select certificate" prompt and I even cannot switch to it as Alert.

Did somebody solved this issue?

like image 840
Pavel Janicek Avatar asked Jul 21 '11 09:07

Pavel Janicek


1 Answers

Instead of installing the Client Certificate you could just tell Chrome to ignore the untrusted certificate error using the --ignore-certificate-errors command line switch.

To do this, create your instance of ChromeDriver as follows:

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", Arrays.asList("--ignore-certificate-errors"));
driver = new ChromeDriver(capabilities);
like image 196
Dave Webb Avatar answered Sep 23 '22 16:09

Dave Webb