How to Use Variables and Secrets

Variables and secrets are essential for test automation to securely store sensitive data such as API keys or passwords and dynamically adapt to changing test environments, to ensure robust and confidential test execution.

Note

Note that Scale Call-to-test, parameters and test data will not work with the automation feature.

In Reflect, we use Secrets to store sensitive values securely. These are like Variables, but they're stored separately and encrypted for added security.

Using Secrets

You need secrets in an automated test with passwords (for example in a login test). Instead of putting the password in plain text where it could be seen, you can use Secrets to keep it secure.

  1. In the Reflect app, navigate to the Tests section and click on Secrets link:

    Reflect-test.png
  2. Add a new secret, in this case a ‘Password’. Set a default value and save.

  3. In Zephyr Scale you can call this secret using the notation ${sec(Password)}

    image-20240315-052116.png

Using Variables

  1. In the Reflect app, go to Account Variables.

    image-20240315-052249.png
  2. Add new variables and click Add Function.

  3. Go back to Zephyr Scale you can call this secret using the notation ${var(randomEmail)}

    image-20240315-052442.png

To learn more, check Reflect’s documentation on Variables and Functions: Variables & Parameters | Reflect

Publication date: