Forum Discussion
Thanks it worked out and able to get the result set in Array
Here is the script
import groovy.xml.*
import groovy.json.*
//DB Response
def dbresponse = context.expand( '${JDBC Request#ResponseAsXml}' )
log.info dbresponse
def dbsluper=new XmlSlurper().parseText(dbresponse)
log.info dbsluper
//Json Response
def jsonresponse = context.expand( '${REST Request#Response}' )
log.info jsonresponse
def jsluper=new JsonSlurper().parseText(jsonresponse)
log.info jsluper
//Writing the json specfic data into an array
def jsonvalues=[]
jsluper.DelinquencyRecord.each{
jsonvalues.add(it.key)
//jsonvalues.add(it.value)
}
jsonvalues.sort()
log.info jsonvalues
//Writing the DBData into array
def dbvalues= []
dbsluper.ResultSet.each{
dbvalues.add(it.text())
}
log.info dbvalues
1.How can I get Json data as (Key:Value) in my array(Here Json Array name is jsonvalues)
so that I can compare the result set of DB and Json data
Here I'm trying to compare the JSON response to DB Response