chir
7 years agoSenior Member
json parsing using json slurper
I have done xml parsing using groovy script for reading the response. Can any one tell me how to do the same for JSON Response parsing
Here is the xml parsing script
import com.eviware.soapui.support.XmlHolder
import jxl.*
import java.io.*
def groovyUtils=new com.eviware.soapui.support.GroovyUtils(context)
def holder= groovyUtils.getXmlHolder(messageExchange.responseContent)
//namespaces
def ActualResponse = holder.getNodeValue("//soapenv:Envelope//soapenv:Header//tn:response//hd:field1")
log.info "ActualResponse" + ActualResponse
def myTestCase = context.testCase
Workbook workbook1 = Workbook.getWorkbook(new File("C:\\xyz.xls"))
//Need same thing to be handled for JSON ..any one knows this.?