I have provided the response body, I just need to know what to put in the verification script to convert the response into JSON object so then I can verify it.
Thanks for the response but the JSON object is how it should be and what I expect. The problem is that the response body is a string and I need to convert it into a JSON object.
Here is the response:
{
“enc”:"[{“config”:{“listobj”:[{“listobj1”:[{“text1”:“UPPERTHIS”,“text3”:“lowerthis”},{“text1”:“UPPERTHIS12”,“text3”:“lowerthis12”}],“text1”:“UPPER1”,“text2”:“lower1”,“text3”:“REPLACEXX1234”}],“text1”:“UPPER”,“text2”:“REPLACE1234”,“text3”:“lower”,“text4”:“1234567890”,“text5”:“1234”}}]"
}
How do I verify that text1 is set to UPPERTHIS (the response must be converted to a JSON object first)
The Web Server most definitely does not have a bug. You are wrong.
The JSON it is sending just needs to be unescaped. Here is some information on what that is so you are aware in the future. https://onlinejsontools.com/unescape-json
I was able to find a solution. The JSON had to be parsed not just once, but twice using JSON slurper. Then I had to define the correct response as what I expected and used the assert function to make sure the second slurped response was equal to the correct response.
Otherwise, backslash character \ will not be rendered appropriately when others see your post. Your problem might be misunderstood due to missing \ characters.