import net.sf.*;
import net.sf.json.*;
import net.sf.json.groovy.*;
import net.sf.json.groovy.JsonSlurper
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
//Getting response from methods
def response = context.expand( '${Request 1#Response}' ).toString()
def slurper = new JsonSlurper()
def json = slurper.parseText response
def countryList = json.result.size()
def ActualResultNodeCount=countryList - 1
log.info ActualResultNodeCount
This is also very useful when accessing test case data.
import java.net.*
def ts = context.testCase.getTestStepByName("RequestMaori-culture")
def endpoint =ts.getPropertyValue('Endpoint')
log.info endpoint
No comments:
Post a Comment