Forum Discussion
bessie
New Contributor
Thanks a lot for your reply. Do you also want to see the screenshot of raw data of response? If yes, please see the attached "raw of response.jpg" file.
No attchement in response of HttpRequest. Plase see attached "xml of response.jpg" file.
nmrao
9 years agoChampion Level 3
Looks there are no attachments and you are getting the binary data as Response.
So, you may need to extract the response content and save it as zip file using groovy script.
So, you may need to extract the response content and save it as zip file using groovy script.
- bessie9 years agoNew Contributor
Yes, do you know how to extract the response content and save it as zip file? Would you please share code with me? Thanks again.
- nmrao9 years agoChampion Level 3Don't have readily available script for this specific case. But take a look at the script provided in the below thread to start with.
https://community.smartbear.com/t5/SoapUI-Open-Source/Saving-attachments-automatically/td-p/880
What you need to changes is that extract the content from response using xpath then provide it to save into the file.- bessie9 years agoNew Contributor
Now after running changed scripts, .zip file is created. However, cannot open it, please see attached picture. Would you please see which script line I missed? Thanks.
def responseBody=testRunner.testCase.getTestStepByName("ExportApplication").httpRequest.response.responseContent; //InputStream ins = new ByteArrayInputStream(responseBody.getBytes("UTF-8")) InputStream ins = new ByteArrayInputStream(responseBody.getBytes()) log.info responseBody def outFile = new FileOutputStream(new File('C:/temp'+'/TestCreateDeleteApp_1.0.zip')) if (ins) { com.eviware.soapui.support.Tools.writeAll(outFile, ins ) } ins.close() outFile.close()
Related Content
- 2 years ago
Recent Discussions
- 6 days ago
- 10 days ago