Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Variables can be extracted from Test Case's responses and can be used in subsequent HTTP requests (test cases). To extract the variable's values from test case's actual results, please follow the steps below:

  • Expand the test case from which you want to extract variables
  • Go to "Variable Extractor" sub tab
  • Define the variable's name and 
  • In the "JSON Path / XML Path / Utility Method" column, you may provide

    • the JSON path of the API response if the response is in JSON format. For more information, please read JSON Path Syntax.
    • the XML path of the API response if the response is in XML format. For more information, please read XML Path Syntax.
    • utility method to extract data from any type of response. For more information, please read Extracting variable via utility methods.

Let us take an example, how we can extract a variable from API response:

...

Code Block
themeConfluence
languagejs
{
  "id": "54a79b704cba8d5328d087f5",
  "resource_name": "testcase",
  "resource_url": "http://vrest.io/i/demo/m/RVD/create_resource",
  "resource_description": "This API creates a resource on the server",
  "meta": {
	"created_at": "2015-01-03T07:41:21.000Z"
  }
}

...