Forum Discussion
rohitvarsha12
8 years agoContributor
To add to above point. I was referring to JSON format.
- PaulMS8 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")
}
- nmrao8 years agoChampion 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