Solved
Forum Discussion
nmrao
7 years agoCommunity Hero
It is trivial error.
You are expecting string "true" instead of boolean value. just remove the double quotes around true.
You can make out the data type of the json property value. If the value is enclosed between double quotes, then it is String type. Otherwise, it could be boolean, int, double, long etc.,
In your case
"success" : true
So:
def parsedResponse = new JsonSlurper().parseText(response.text)
assert true == parsedResponse.header.success
You are expecting string "true" instead of boolean value. just remove the double quotes around true.
You can make out the data type of the json property value. If the value is enclosed between double quotes, then it is String type. Otherwise, it could be boolean, int, double, long etc.,
In your case
"success" : true
So:
def parsedResponse = new JsonSlurper().parseText(response.text)
assert true == parsedResponse.header.success