Handling 'choose a digital certificate' with selenium webdriver chrome Handling 'choose a digital certificate' with selenium webdriver chrome google-chrome google-chrome

Handling 'choose a digital certificate' with selenium webdriver chrome


You'll have to use something like AutoIT:

http://www.autoitscript.com/site/autoit/

Why you ask? It's an OS dialog, which Selenium does not and probably never will handle, so you'll have to turn to other solutions (in C# you should use native Win32 API methods to click the button for instance).


Certificates are managed by the OS, not the browser. Delete all but the necessary certificate from your browser's certificate store and then configure the browser to automatically select the certificate when only one certificate is present. You could also create a browser profile and have your program launch this profile or avoid testing over HTTPS.


before handling anything here, add below so it will not get frozen as soon as you navigate/triggert the certificate pop up. remeber to add the correct waittime back later.

 getDriver().manage().timeouts().pageLoadTimeout(1000, TimeUnit.MILLISECONDS); 

after this, then you can try using keyboard or autoIt whatever .