Has anyone tried using test script to capture a string?

Has anyone tried using test scripts to capture a string from JSON response and store it in a Text file on local PC dir ?

I’ve managed to capture into a variable in Postman.
Looking for some guidance to capture into a text file. Makes it easier for me to run a script to convert into a PDF or direct port to a printer (separate programs).

Thanks.

Hey @flight-specialist-33

You wouldn’t be able to do that in the Postman UI as you cannot write to your local file system and create a file with that value.

You could use Newman as a library and create a short script to extract the value and write it to a text file.

There are examples of using Newman to write to a local file, on the community forum.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.