In a multi step API Monitoring (Runscope) test, a variable is successfully set in one step, but when attempting to use the variable in a later step, the test throws an error indicating the that the variable is undefined.
The variable name was defined and then used later with a leading space. API Monitoring does not support variable name that contain spaces including leading spaces. These can be detected in the resulting JSON file when the test is exported. In the step where the variable is defined the variable section of the step will look similar to the following:
"variables": [
{
"source": "response_json",
"property": "data.runs[0].api_test_run_url",
"name": " url1l"
}
],
The step where the variable is used would look similar to the following (in this case the variable is used for the URL in the step):
"url": "{{ ur1l}}",
Release : SAAS
Component : BLAZEMETER API MONITORING
Remove all spaces in variable name definitions and wherever the variables are used in the API test.