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.

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:

  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)}


Using Variables

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

  2. Add new variables and click Add Function.

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


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

Publication date: