Forum Discussion
KonstantinosLps
7 years agoOccasional Contributor
Hi Aman111,
i understand that you use this request in each MockResponse?
If you want to seperate each response, you can try add the code in each "Script" section in every mock. Probably, what you do here, trying to access multiple mock responses from one place does not work.
So you can try something like the below code (not tested):
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();
mockOperation.setDefaultResponse("Response");
log.info("===================matching tag=========================="+it.text());
}
}
So, depending on what mock request you do, you get the corresponing response.
Regards,
-Konstantinos
Related Content
- 9 years ago
Recent Discussions
- 13 hours ago
- 2 days ago