Write to a CSV file from postman test

Hi All

I have been using CSV file to read data. No issues with reading data from a csv file. I am wondering if we can write to a csv file from postman tests. I came across below documentation: Write Responses To File

Here is my scenario:

  1. I am using postman to write API tests and newman to run the tests from Jenkins

  2. Make a get call to fetch N number of XML file links (For example: The response will be like https://xxxx1.xml to https://xxxN .xml. and N can be more than 40) - DONE - This is done using postman and I am storing these XML file links in an array list (XML file links not XML file)

  3. Iterate through each XML file link till Nth XML file and make a call to each XML file link.
    The response is in the XML format and these XML response has URL links inside - (I am parsing the response of these XML links and I am
    able to get the URLs. There are more than 100(say X) URLs in each XML file link - I am storing this in a list and saving this in an env variable so that I can access the list (say LIST_A) env variable in the next test. DONE

  4. I need to go through each XML file link (N files) dynamically , parse the response to extract the URLs and validate every URL (X number of URLs in each XML file link) to make sure it returns 200. I am using another list(LIST_B) to store all the URLs-DONE

  5. Instead of storing all the URLs from each XML file link into a list(LIST_B), I would like to store the parsed URL links in a CSV file

  6. I would like to read the URLs from the CSV file and validate the URLs using a GET call

  7. Pl suggest me an efficient solution as I do not want to over load the env variable(List) as I may hit size limitation due to number of elements in the list.

I’ve already tried: Tried storing the list into an env variable .
Notes: I came across the below article using Node JS and newman. I am not sure if this solution can be used to write just the URLs for my scenario above. How to save String from json response to excel or csv file?

Thanks, Raje