My question:
I want to take the data I have in my body and utilize it in a Test script. Such as, whatever is inputted into the “id” field will be tested against the received data, and I don’t manually have to input it as a parameter. Therefore using “id” in the body as a parameter against the response in a test script.
**Details :
My body layout:
My Test layout: (highlighted in yellow is not working)
How I found the problem:
from my understanding, pm.response.json() is the data receieved. Therefore I cannot use it to get the id from the body? I can manually input the id I want to test, which will work.
Side Note:
I tried using jsonData on my Eligible test, but it wasn’t working. Then I used the pm.response.json()[0].Eligible).to.eql(true) and that worked. So I left it.
I’ve already tried:
I have tried different responses from the help page. I commented out what I have tried but took out the var associated with them from the clutter of hours of testing.
I tried-- “id” : “{{89784}}” in the body but that caused and Erro 500 process terminating
I welcome any documentation to help me further progress.
I will continue looking at the documentation. If I find a solution, I will take down the post. Thank You.