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

Viewed 2114

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.

2 Answers

There is no way to write back to data file in postman as of now .

However, you can populate that in your environment file at run time using

pm.environment.set("varname")

keep varname in such a way that you understand this is the variable you wanted to write back into data file.

Related