Install a web certificate during automation testing
Install certificates during automation testing to ensure secure connections for test scenarios. Use this task when certificates are not set to auto-install. You can also select previously uploaded certificates for Scriptless, PAT, and Perfecto/MCP test executions.
On macOS, Perfecto removes installed web certificates automatically when the desktop web session ends.
Perform the following steps:
-
Upload the required web certificates to the Web Certificates view.
-
Add the
installCertificatescapability to your Selenium automation tests, specifying the certificate file names:CopySelenium exampleDesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("installCertificates", List.of("c1.pem", "c2.crt"));If you run Playwright tests on Perfecto, you can pass the same
installCertificatescapability with a list of certificate file names.CopyPlaywright example
JsonArray certs = new JsonArray();
certs.add("c1.pem");
certs.add("c2.crt");
capabilities.add("installCertificates", certs);To learn more about this capability, see Web machine configuration capabilities.