Set Variable Step
Overview
The Set Variable Step creates a Runtime Variable from another Variable.
Source and Source Path
Similar to the Verifications, the Source property of the Set Variable Step always points to a Variable Name. You could use the Source Path property to specify JSONPath or XPath to extract parts from the Source Variable. See more about path expressions here.
Variable
Specifies the name of the Variable to set. Note that if a Variable with the same Name exists on the Specified Level, its Value will be overwritten.
Conversion
Use the Convert To property to convert the Source. This functionality is very useful when encoding parameters for access token.
Currently supported conversions:
- url-encode
- url-decode
- base64-decode
- base64-encode
- MD5
- SHA1
Level
Set Variable can create Test Level (local) and Project Level (global) Variables. See Variables for more information.
Usages
- Save part of a large response in order to simplify the Verifications (usually to shorten the JSONPath)
- Save part of a response to be used from other tests (for example Access Token)
- Convert value to Base64