Forum Discussion
- rohitvarsha12Contributor
To add to above point. I was referring to JSON format.
- PaulMSSuper 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.
- rohitvarsha12Contributor
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")
}
- nmraoChampion Level 3Better you create a new topic in the forum with required details so that some one can understand. Encourage you not to cross posts.
Related Content
- 2 years ago
- 9 years ago
- 8 years ago
- 2 years ago
Recent Discussions
- 15 years ago