TestProject Forum
Powered by leading experts in the test automation community

RestApi testing more options in one step

Hi,
I want to know will you support more options on API call in one step?
e.g., JSON response. Now we can save response to parameter depending on entered JsonPath. If we enter JsonPath, then our response changes to the value specified by JsonPath.

I want to check if all required fields are in, we can do it via validation, to check if all fields are the correct type and I want to take value from the specific type and save to parameter.

BR,
Hrvoje

Hello and thanks for reaching out to us.

We always value community feedback and requests.
You would like a feature in the RESTful API addon to extract a specific value from a response?
Could you please describe in more detail what exactly you are looking for?

Hi David,
Yes, I would like to extract specific value and to have an unchanged response. Right now, we can get particular value from a response using JsonPath and store it as a parameter. That step, unfortunately, changes response to the specific value found in response. Because of that, the received response is no longer available.
For example, I have a JSON response with this format:
{
“message”: “string”,
“code”: “string”,
“data”: {
“token”: “string”,
“unreadCount”: 0,
“homeLocation”: {
“lat”: 0,
“lon”: 0
}
}
}

If I use Jsonpath : $.data.token, response becomes token value. And if I want to validate if fields are contained in the response, I will get an error.
To perform validate on received fields, I will need to trigger the same request twice. One for validate and one to take token value.
I would like it if we could, in one step, validate JSON response for fields and store specific value to a parameter.
Maybe if you could add an additional input field something like “Store response value to a parameter”, with the same approach as JsonPath, that will store value to a parameter and leave response unchanged.

Best regards,
Hrvoje