Forum Discussion
RJanecek
13 years agoRegular Contributor
ok so groovy script:
you must edit this line:
Zadost#Response -> Zadost is the name of Test request and response is response of this request
you can also check this when you right click in groovy script -> Get Data.. rest step -> response (I cant test this because my soap pro version doesnt work) but the exception which you wrote indacate that groovy script cannot find your response
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def response = context.expand( '${Zadost#Response}' )
def holderResponse = groovyUtils.getXmlHolder( response )
int didTargetCount = Integer.parseInt (holderResponse.getNodeValue( "count(//*[local-name()='didTargets'])") )
for(int i = 1; i <= didTargetCount; i++){
def did = null;
didType = holderResponse.getNodeValue( "//*[local-name()='didTargets' and namespace-uri()='http://cleveland.vonage.com/services/servicelayer'][" + i + "]"+
"//*[local-name()='didType' and namespace-uri()='http://cleveland.vonage.com/services/servicelayer']")
if (didType.equals("PHYS")){
did = holderResponse.getNodeValue( "//*[local-name()='didTargets' and namespace-uri()='http://cleveland.vonage.com/services/servicelayer'][" + i + "]"+
"//*[local-name()='did' and namespace-uri()='http://cleveland.vonage.com/services/servicelayer']")
}
println did
}
you must edit this line:
def response = context.expand( '${Zadost#Response}' )
Zadost#Response -> Zadost is the name of Test request and response is response of this request
you can also check this when you right click in groovy script -> Get Data.. rest step -> response (I cant test this because my soap pro version doesnt work) but the exception which you wrote indacate that groovy script cannot find your response