what correction i need to do in my script so that my output will be independent of Default response
I create one project in which if i am writing CountryISOCode , i will get back in return Capital of that country. I made this below script but its not working , because my output of request is dependent on default Response 1 and Response 2. If I choose Response 1 i got back only result of 1 country capital with respect of CountryISOCode . I want help what changes i can do in my below script so it will be independent of my default Response 1 and Response 2 .
def temp="XX";
def groovyUtils=new com.eviware.soapui.support.GroovyUtils(context)
def xml=new XmlSlurper().parseText(mockRequest.requestContent)
xml.breadthFirst().each{
def v=it.toString()
log.info("==============="+it.name()+"==================="+it.text());
if(it.name()=="name"){
temp=it.text();
log.info("===================matching tag=========================="+it.text());
}
}
//log.info("*temp**"+temp);
if(temp=='IN'){
log.info("if Response 1");
mockOperation.setDefaultResponse("Response 1");
}else if(temp=='UA'){
log.info("else if Response 1");
mockOperation.setDefaultResponse("Response 2");
}