I have request with parameters (image 1)
I 'am getting response with array with multiple objects . I need test to go through and check if each object have value between or equal to values in request.
My final goal is to create pm.test where I can check that all of objects are inside those values
response - images -2,3
Details (like screenshots):
How I found the problem:
I’ve already tried:
hey @sergeyor Welcome to the community
So the request which gives you the parameters, ‘orgUnitFrom’ and ‘orgUnitTo’ you can either save these value to the Collection or Environment variables to use them later in another request or you can just copy these value and use in your Test function.
In the request where you have the array of objects, just run a loop and check for ‘orgUnit’ to be between the parameter, one way you can do this is:
let orgUnitFrom= 390101020
let orgUnitTo= 390102101
//you can also store those value in Environment or Collection variables in
//first request and retrieve them here
Hope this helps,
Thank you for reply
If I understand correctly the pm.test only check if response values are equal to request values
but response have also values between those two values.
Can your test also check for those between values?
will check each response values to be between those values, also also if they are equal.
Thank you very much