Forum Discussion
PaulMS
Super 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.
rohitvarsha12
8 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
- 3 days ago