API Monitoring (Runscope) API Test Variable Set in One Step is Undefined When Used in a Later Step

book

Article ID: 196773

calendar_today

Updated On:

Products

BlazeMeter

Issue/Introduction

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.

Cause

 

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}}", 

 

Environment

Release : SAAS

Component : BLAZEMETER API MONITORING

Resolution

 

Remove all spaces in variable name definitions and wherever the variables are used in the API test.