Skip to main content

Saving a Variable in Vault

Consider a scenario where a Request Header is required for all the endpoints in your test.

Request HeaderRequest Header in all endpoints

While this is a perfectly valid request header, it can be hard to manage and update if you scale out your tests. Therefore, rather than continuously hard-coding this value into the Request Header field, a safer and more efficient approach is to export this value in to a variable.

The following is an example of how it might look in the project-specific Vault:

Request Header variable in the vault
Sentitive Data

When the variable contains sensitive data and you don't want leave it in plain text you can mark it as Sensitive and it will be masked from everywhere it is used.

Now you can switch the Request Header field from a String value to a Variable and enter the variable name: header_key (see the screenshot below). This allows you to have multiple tests in your project using the same header.

Request Header with variableRequest Header in all endpoints as variable