Troubleshooting

This section describes some issues you may encounter and how to resolve them.

VisualTest is inaccessible or non-performant

Issue:

VisualTest is down, inaccessible, or not operational.

Suggested solution:

Check uptime status and incidents for VisualTest here: https://visualtest.statuspage.io/

Out-of-date ChromeDriver

Issue:

Chrome frequently updates itself, requiring users to update their ChromeDriver version.

Suggested solution:

Update your ChromeDriver version here: https://chromedriver.chromium.org/downloads

Baseline changed unexpectedly

Issue:

After running a test, instead of providing comparisons, VisualTest defined a new baseline.

Suggested solution:

VisualTest will create a new baseline if any of the following variables change:

  • image name

  • image type (fullpage, viewport, element)

  • operating system

  • browser type

  • resolution

For this reason, it is important to stay consistent in the way you name images.

Unable to connect to SSL services (Java SDK)

Issue:

Unable to connect to SSL services due to the PKIX Path Building Failed error. It appears when you try to access encrypted applications or websites with SSL. As a result, the connection is refused as it cannot be trusted.

Suggested solution:

Java contains a truststore with a list of all known Certificate Authority (CA) certificates. Java will only trust certificates in two cases:

  • If they are signed by one of those CAs.

  • If they are public certificates within the truststore.

This problem is therefore caused by a certificate that is self-signed (a CA did not sign it) or a certificate chain that does not exist within the Java truststore. Java does not trust the certificate and fails to connect to the application.

To fix this, you need to import a public SSL certificate into a JVM via command line:

  1. Fetch the certificate.

    For MacOS and Linux:

    openssl s_client -connect api.visualtest.io:443 -servername api.visualtest.io< /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt

    For Windows:

    openssl s_client -connect api.visualtest.io:443 -servername api.visualtest.io< NUL | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt

    Ensure that you have an OpenSSL and SED installed on your machine.

  2. Import the certificate.

    For Java 8:

    <JAVA_HOME>/bin/keytool -importcert -alias <server_name> -keystore<JAVA_HOME>/jre/lib/security/cacerts -file public.crt

    For Java 11:

    <JAVA_HOME>/bin/keytool -importcert -alias <server_name> -keystore<JAVA_HOME>/lib/security/cacerts -file public.crt

    If the cacerts file already has a certificate for the same server name, the import may fail with the following error:

    keytool error: java.lang.Exception: Certificate not imported, alias already exist

    If this happens, you first need to remove the existing certificate from cacerts before re-trying to import the new certificate. To remove the existing certificate, you can use the command below:

    For Java 8:

    <JAVA_HOME>/bin/keytool -delete -alias <server_name> -keystore<JAVA_HOME>/jre/lib/security/cacerts

    For Java 11:

    <JAVA_HOME>/bin/keytool -delete -alias <server_name> -keystore<JAVA_HOME>/lib/security/cacerts
  3. Restart your application.

  4. Test your connection.

See Also

Publication date: