Forum Discussion
rohitvarsha12
Contributor
To add to above point. I was referring to JSON format.
PaulMS
8 years agoSuper Contributor
Rohit,
If the expected result is blank then the JsonPath Match assertion should be similar to
Expression
$..YourPropertyName[0]
Expected Result
(leave blank)
Otherwise try JsonPath Existence Match if the expected result is not always blank.
- rohitvarsha128 years agoContributor
Below code worked for me:
import groovy.json.JsonSlurper
def slurper = new JsonSlurper()
def i = 0
responseContent = context.getProperty("Response")
//log.info(responseContent)
slurperresponse = new JsonSlurper().parseText(responseContent)
if(slurperresponse.loanDetails.field) {
log.info("Found")
} else {
log.info("Not Found")
}
Related Content
- 2 years ago
- 9 years ago
- 8 years ago
- 2 years ago
Recent Discussions
- 15 years ago