Active1 year, 1 month ago
- Java Client Driver
- Selenium Java Client Driver For Mac
- Download The Selenium Java Client Driver
- Selenium Java Client Driver
I'm trying to use Java and Selenium to test a website that requires a client certificate.When I browse to my site I get a popup like the one below to select the correct certificate.
Here we are configuring selenium 2 with java so we need ‘webdriver Java client driver‘. 1) Click here to go on WebDriver Java client driver download page for WebDriver download file. On that page click on ‘ Download ‘ link of java client driver as shown in the below image. The easiest way to set up a Selenium 2.0 Java project is to use Maven. Maven will download the java bindings (the Selenium 2.0 java client library) and all its dependencies, and will create the project for you, using a maven pom.xml (project configuration) file.
My requirements are as follows:
- Select a certificate by name
- On different versions of Windows / IE / Edge
Java Client Driver
Ideally the popup is never shown; i.e., the solution would involve invoking some API or setting some configuration to pin the correct certificate to use.
Selenium Java Client Driver For Mac
My own solution ideas:
- I tried a solution based on visually detecting the correct certificate using SikuliX (which does works) but I'm wondering if there is a better solution that does not rely on visually detecting the popup. Something that is less likely to fail across multiple versions of Windows and that is future proof if Microsoft decides to change the appearance of this popup.
- Another idea that I had (but I don't know how/if it is possible) is to remove all installed certificates except for one so that the popup is never shown:
- Backup the entire store
- Remove all client certificates that IE could use (except the one I need)
- Do the login which would no longer require any certificate selection
- Restore the backed up store
Does anyone know how to do this (in Java, possibly invoking CLI commands)? - Is it possible to start (using Selenium Java) an Internet Explorer Window that only knows the single certificate that I need?
- Is it possible in Internet Explorer to set a default certificate for a given domain?
neXus
neXusneXus
78622 gold badges1010 silver badges3434 bronze badges
Download The Selenium Java Client Driver
1 Answer
I can't say for sure, but I wouldn't be surprised if this was impossible with selenium.
This question doesn't fill me with hope:Selenium can't deal with Confirm Certificate popup in IE
The further you get away from the webpage and towards native browser and then OS controls, the more impotent Selenium becomes.
As the only answer to the linked question states: you can disable the popup in the browser, which may or may not be a workable solution.
If you don't want to go down that route, people most often fall back to a Java Robot to handle things that the selenium driver can't do e.g. interact with the print dialogs and other such controls.
See mouseMove, mousePress, mouseReleaseYou'd call each of these, providing the button position to mouseMove.https://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html
Selenium Java Client Driver
JoolsJools
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.