How to write to local file system using a postman collection java script

  1. Ensure that you have node and npm installed.
  2. Install newman with: npm install newman.
  3. Create a file with the following contents:
Here is another example:

3 thoughts on “How to write to local file system using a postman collection java script

  1. Paul says:

    Hi,

    I started working with Postman from couple of days and I have the below issue where I currently struck.

    I have a GET request XML with parameters (no request body) which I have parameterrized and able to send the request with multiple data sets using csv file (using collection runner). But I need to save the response of each and every request, but I am not sure how to do it using a script. I need to save response in XML format to local drive. Can you please help me?

  2. Ourhints says:

    Sorry for late response. This can be best accomplished within Postman’s CLI companion, Newman. You would then write a script to generate your custom reports via the following steps:

    1. Ensure that you have node and npm installed.
    2. Install newman with: npm install newman.
    Create a file with the following contents:

    Run the file with:
    node script.js # Here, script.js is the file created in the previous step

  3. Brooke Niten says:

    Wonderful, what a weblog it is! This weblog provides valuable information to us, keep it up.|

Leave a Reply

Your email address will not be published. Required fields are marked *