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:

  1. Upload the required web certificates to the Web Certificates view.

  2. Add the installCertificates capability to your Selenium automation tests, specifying the certificate file names:

    Copy
    Selenium example
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("installCertificates", List.of("c1.pem", "c2.crt"));

    If you run Playwright tests on Perfecto, you can pass the same installCertificates capability with a list of certificate file names.

    Copy

    Playwright 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.

What’s next