On this page:
On this page:
This page is solely intended for use with the Private Synthetic Agent. You will not be able to run some of the synthetic scripts below with the Hosted Synthetic Agent.
When using client certificates, you may need to select the certificate from a dialog. To do this, you will need to install the Python pyautogui library on the host machine of your Private Synthetic Agent. The
pyautogui library enables you to navigate the UI to select a client certificate.
Install the pyautogui Library
To install the PyAutoGUI Library:
- Log in to the host machine for the Private Synthetic Agent as the
- Open a PowerShell console.
pipto install the library:
> pip install pyautogui
Select the Only Client Certificate
When you manually navigate to a site that uses client certification, IE10 may prompt you with an alert dialog to select one client certificates as seen below:
To select the client certificate from a synthetic script, your code could focus on the alert dialog and accept the given client certificate as performed by the synthetic script below.
Select Certificate from List
In the case where your synthetic job needs to select one client certificate from a list presented in the alert dialog as shown below, you can use the PyAutoGUI Library to select and accept the client certificate that you want.
In the example below, you use
switch_to_alert to focus on the alert dialog, and then use the
pyautogui library to navigate to the correct certificate (tab), select it (enter), and then navigate to the OK button to select it (tab, enter).
You may have many more client certificates to choose from, so you will have to figure out the best way to use the PyAutoGUI APIs to navigate around the alert dialogue to select and accept the correct client certificate. See Keyboard Control Functions in the PyAutoGUI documentation for more information.