Forum Discussion
Hi Rao,
This problem is similar to one you have already provided solution. In earlier solution we wanted to fetch account details from DB and then load it to response from external path. That solution is working fine. In this case we need account number from response and not from earlier DB.
I will set projectlevel property Order1
1) I have request1 and corresponding response1. The response1 have account number
I need this account number to be loaded into an external file saved as Order1.xml with Order1 as input (You have provided an earlier solution to this and we dont want to alter the mock Response level script here, as this we need to act as an independent entity.)
2)Next is request2 will hit to server and code will invoke request3 with mock URL with input Order1 to get external Response3 and we need to load account number here.
I tried Account number to set to global property and then in external file giving account number value as #Global#Acct_nb . On Windows I am able to see Global property is getting transferred and I am able to load external file with account number generated. However when I am loading the project on Linux server and ran testrunner.sh, property transfer is getting failed.
Please let me know if there is a way to do this. All we need is not to alter your earlier solution of mock Response script (below is same for reference)
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)
def OrdNum1 = holder.getNodeValue("//*:GetOrderDataInput/*:orderNumber")
def file = new File (groovyUtils.projectPath+"/MOCK/GCP/GammaGetOrder/${OrdNum1}.xml")
def fileToLoad = 'soapFault'
if (file.exists()) {
fileToLoad = OrdNum1
}
context.content = groovy.xml.XmlUtil.serialize(new XmlParser().parse(groovyUtils.projectPath+"/MOCK/GCP/GammaGetOrder/${fileToLoad}.xml"))