Secrets Manager

Sometimes sensitive information, such as admin credentials for a production environment, a phone number, or an ID number is used in testing. In such cases, you don't want the secret information to be exposed in version history or stored in plain text.

Testim features a Secrets Manager that allows you to centrally manage sensitive values. These values are stored encrypted in the database using the AES-256 standard. A secret can be assigned to a step and reused across tests, including as a Shared step.

It's important to note that during the test execution, however, secrets are printed to the browser and are therefore not encrypted at runtime.

📘

As a general practice, we recommend adhering to the best practice of avoiding testing on a production environment with sensitive data. Instead, it is advisable to utilize dedicated environments with non-sensitive information. However, if this is necessary, we recommend using the Secrets Manager feature.

Secrets manager

To access the Secrets manager, select Resources from the main menu. Here you can see and manage all your secrets. You can also see:

  • The user who created the secrets.
  • When they were created.
  • When they were last updated.
  • Which tests they are used in.

You can also access the secrets manager from the test editor. Select the test with the secret, select Properties then select Go to secrets manager.

Create a Secret

💡

Note that the Secrets Manager is now accessible under a new tab called Resources, where you'll find the Secrets and Hidden Param section.

To create a new secret, follow these steps:

  1. Go to Resources > Secrets Manager.

  2. Click New Secret.

  3. In the Name field, enter a name for the secret. Make sure you follow the correct syntax described below.

  4. In the Value field, enter the value that is being kept secret (e.g. phone number, password, etc.).

  5. In the Description field, optionally enter a description for the secret.

  6. Click Create.


Edit or Delete a Secret

To edit or delete a Secret, follow these steps:

  1. Open the Secrets manager by selecting Resources from the side menu.
  2. Right-click on the secret you want to edit and select Edit. To delete the secret, select Delete instead.

❗️

If your secret is used in tests, you have to delete it from there first. To check that, select the drop-down menu under Using Tests.


Use Secrets in Tests

When recording a test, you can enter text into a field in the AUT, which creates a Set Text step. In the Set Text step properties instead of entering a value that will be entered into the field, you can assign one of the previously created secrets.

To add a secret to a test, follow these steps:

  1. Open the test editor and select the step you want to add the secret to.
  2. Select the Show Properties button on the Set Text step.
    The step's Properties pane is displayed.
  3. Under Assign, select the Secret option.
  4. Select the secret you want to use from the list.

Test Data

You can also use secrets as part of your Test Data by referencing them in data-driven steps. Simply onfigure predefined secret parameter in the test data editor so that these secrets are used when the test is run:

parameterName: SECRETS.parameterValue.<value>

Example:

View Test runs with Secrets

Test runs that secrets are marked with an Encrypted Credentials icon (see below).