# Is postman just for testing or can I use it to script a production routine?

**URL:** <https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837>\
**Category:** Help Hub\
**Created:** [January 4, 2021, 5:03pm UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837 "2021-01-04T17:03:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![msimcich](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@msimcich](https://community.postman.com/u/msimcich)\
**Post date:** [January 4, 2021, 5:03pm UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/1 "2021-01-04T17:03:34Z")

</div>

The Postman website uses the term ‘testing’ to describe it’s purpose. I can test the API I need to pull data from using Postman, which is already useful. I am wondering if I can also use Postman to script the connect and download the json data as part of a set of routines that can be automated via powershell and task manager (or whatever) to make the requests?

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [January 5, 2021, 12:44pm UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/2 "2021-01-05T12:44:45Z")

</div>

Why not?

If you are able to do exactly what you need to do through the execution of APIs, then go for it. Postman has a number of triggers that can kick off workflows, so you’re set.

---

<div class="post-metadata">

**Author:** ![msimcich](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@msimcich](https://community.postman.com/u/msimcich)\
**Post date:** [January 5, 2021, 10:04pm UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/3 "2021-01-05T22:04:41Z")

</div>

Sounds good I’m checking it out. Thank you!

---

<div class="post-metadata">

**Author:** ![msimcich](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@msimcich](https://community.postman.com/u/msimcich)\
**Post date:** [January 6, 2021, 6:41am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/4 "2021-01-06T06:41:14Z")

</div>

I have a GET request in a collection called openweathermap. When I run the request in postman, I get the json payload. That collection is also listed in Collection runner, but when I select it and click “Run openweathermap”, it fails 0 Passed 0 Failed. The specific error is  
GET  
Error: runtime:extenstions~request: request url is empty  
In postman, all I’ve done is fill out the testing url…do I need to save it or something of that order, so that Runner knows the url? Otherwise how do I inform Runner of the url?

---

<div class="post-metadata">

**Author:** ![praveendvd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/praveendvd/32/6796_2.png) [@praveendvd](https://community.postman.com/u/praveendvd)\
**Post date:** [January 6, 2021, 7:09am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/5 "2021-01-06T07:09:13Z")

</div>

yes you have to click save .

![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/b/5b28179fa34688439f391c0f182cc86dae157ba5.png)

Make sure the orange dot is removed , the dot indicates there are unsaved changes

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [January 6, 2021, 8:44am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/6 "2021-01-06T08:44:26Z")

</div>

Hi @msimcich. just to add on to the above points, if you have defined the URL as an variable of your scope, by hovering over that you can check if the value is present for it not

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/4/f4d4df7891acb6073f0a0668886bb2c2140c9f0d.png)

If this variable looks red, its unresolved !

---

<div class="post-metadata">

**Author:** ![msimcich](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@msimcich](https://community.postman.com/u/msimcich)\
**Post date:** [January 6, 2021, 3:49pm UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/7 "2021-01-06T15:49:29Z")

</div>

Thanks both of those are useful. The url issue is resolved - it turns out there was no url in postman, I was looking at the wrong request. Now it says “This request does not have any tests”. Hints appreciated but I just need to read a bit about this I’m sure.

---

<div class="post-metadata">

**Author:** ![praveendvd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/praveendvd/32/6796_2.png) [@praveendvd](https://community.postman.com/u/praveendvd)\
**Post date:** [January 7, 2021, 5:13am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/8 "2021-01-07T05:13:09Z")

</div>

tests are those defined inside pm.test() function in the test script section .

There are snipet already available for most of the tests 🙂

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/3/5353fa73b1afde4c351b05d0506797c3a2ff3c23.png)

just click test tab , in the right side scroll to status is 200 and it creates the code for asserting that status code is 200

---

<div class="post-metadata">

**Author:** ![msimcich](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@msimcich](https://community.postman.com/u/msimcich)\
**Post date:** [January 7, 2021, 5:32am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/9 "2021-01-07T05:32:22Z")

</div>

OK thanks, the status code 200 test is created and allows the collection to run.  
I would like to save the results of the api call (not the test outcome) to a file after each run. How can that be done?

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 7, 2021, 5:42am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/10 "2021-01-07T05:42:41Z")

</div>

Hi! If you want to save a response body to a file, you can do so by clicking on “Send and download” when you send a request.  
 ![Screen Shot 2021-01-07 at 4.40.53 pm](https://us1.discourse-cdn.com/getpostman/original/3X/8/e/8ebc6b732213a1541bdb44611aee4ed49eed0f60.png)

Alternatively, if you want to save response of whole collection run, you can use newman as suggested here:

> [@Save body results to a CSV or JSON file - using newman](https://community.postman.com/t/save-body-results-to-a-csv-or-json-file-using-newman/5861/2):
>
> Hi @portescheller, Newman is in essence a CLI collection runner, so if you are referring to downloading the results of a collection run onto a json file you can run the following commands on the CLI: newman run mycollection.json --reporters cli,json --reporter-json-export outputfile.json To export the results onto a CSV file, you can download the reporter from the following link and enter the appropriate command on the CLI: But based on the screenshot, I am pretty sure you are referring to …

---

<div class="post-metadata">

**Author:** ![msimcich](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@msimcich](https://community.postman.com/u/msimcich)\
**Post date:** [January 7, 2021, 6:03am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/11 "2021-01-07T06:03:43Z")

</div>

Thanks taehoshino, useful. Is there a way to get runner to save the response body to a distinct file when it runs every hour? Or otherwise record the payload in a storage format, such as a database?

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 7, 2021, 6:26am UTC](https://community.postman.com/t/is-postman-just-for-testing-or-can-i-use-it-to-script-a-production-routine/18837/12 "2021-01-07T06:26:23Z")

</div>

Hey, @msimcich!

If you use newman to run a collection (instead of runner in the native app), you can certainly save the output to a different file, however, I don’t think you can do so from the runner.

Alternatively, you can probably set a [environment/collection variable](https://learning.postman.com/docs/sending-requests/variables/) and store the response, similar to the one suggested [here](https://stackoverflow.com/questions/48113414/how-to-export-download-response-body-into-an-external-file-from-postman-collecti).
