Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to write back to data file in postman?

Tags:

postman

While working with postman, data.someVariable returns data from within a csv file that can also be used as {{someVariable}} in uri/json.

This gives us the data for that variable from that row/iteration.

Is there a mechanism to write back to the data file by doing something like postman.setData('responseCode') = responseCode.

This would be really helpful to store response code in the data file and to record call wise details in same format as the input within csv.

like image 388
overflower Avatar asked Mar 08 '23 12:03

overflower


1 Answers

The only solution I figured out is

  • to populate json objects in the environment with information about the data file name and structure/values of information to be added
  • to create a separate web service (maybe in node.js) that exposes an http call to write to a file and takes in as parameter a json input as the one created in the environment as mentioned above and writes that to a file / original data file (or a copy of it) in the desired format
  • to call the above mentioned web service call at the end of each run or desired rest call execution to generate step wise information/debug report
like image 141
overflower Avatar answered Mar 25 '23 02:03

overflower