Forum Discussion
HimanshuTayal
5 years agoCommunity Hero
Yes this is absolutely possible by adding script assertion and parsing your response and asserting desired values.
Refer below script for help:
import groovy.json.JsonSlurper
//getting data from response
def response = messageExchange.responseContent
//parsing data with JsonSlurper
def jsonSlurper = new JsonSlurper().parseText(response)
//Getting data from properties
def tenure = context.expand('${Properties#tenure}')
//getting data from response's particular node
tenureResponse = jsonSlurper.tenure
//asserting both the data
assert (tenure == tenureResponse) : "Value didn't match in properties : "+tenure+" in response : "+tenureResponse
Hope it will help you 🙂
Related Content
Recent Discussions
- 15 years ago