Ask a Question

Save application/octet-stream to filesystem

New Contributor

Save application/octet-stream to filesystem



I'm using a 'Run TestCase' step in one of my tests that runs one REST Test Step that retrieves an application/octet-stream of a PDF file. What is the easiest way I can save that octet stream to my file system? Up until now I've been using a groovy script to retrieve the rawResponseData and save that to a file, but I've been running into a problem with running this TestCase in it's own Thread, where it will throw a NullPointerException when trying to use the rawResponseData. Strangely enough, it seems to work fine when the test case is called in the 'Run primary TestCase (wait for running to finish, Thread-Safe)' mode but when comes to 'Create isolated copy for each run (Thread Safe)' the rawResponseData associated to the test step is null. 


If there is an easier way to save this file I'm all ears because I really like running my tests in parallel and it would be nice to not have my tests grind to a halt at one step because of it not being able to run in it's own isolated copy. Thanks in advance for your help.



Showing results for 
Search instead for 
Did you mean: