Chaining Multiple Requests
This video tutorial demonstrates, how you may chain multiple requests in vREST:
To chain multiple requests (test cases), 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: In the "JSON Path / XML Path / Utility Method" column, you may provide Let us take an example, how we can extract a variable from API response: Suppose we have an API which creates resource on server and returns the following JSON response: Notes{
"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"
}
}
Few points regarding writing Path in the above table:
Suppose we have an API which updates this newly created resource and it needs the ID of the resource to update. We can use the {{resourceId}} variable (extracted in previous step) in the URL as shown in the following figure: