Send POST request on a repeating schedule

Goal: send POST requests (ideally from a collection) automatically on a schedule. I’m setting up a demo environment in our app for our sales team and the environment needs fresh ‘dummy’ data daily.

I’ve successfully created the request and it shows up in our app when I manually hit ‘send’.

At first I thought I could use the collection runner + monitor to accomplish my goal, but it appears as if the collection runner is JUST for testing, not actually sending the request to the endpoint. Is that correct!?

Is there any way to send a POST request or set of requests to the actual endpoint (not testing/validating) automatically on a daily basis?

I thought this stackoverflow post was the ticket but alas, it is not (or maybe I’m doing something wrong with the runner).

Many thanks in advance!

An engineer on our team cracked the code here - posting for posterity.

Essentially, because I didn’t have anything in the ‘Tests’ tab, the collection being run via monitor wasn’t being sent the endpoint.

I added pm.test("test",function(){});in the Tests tab and now it works flawlessly!

What you mean by not testing or validating ? Testing is when you assert something , if you don’t want to test then remove all assertions from your test section like pm.except

I meant ‘not JUST testing/validating’ aka I wanted the payload to actually hit the endpoint, but before I added that snippet the the tests tab it was simply validating the payload but not sending it to the endpoint.

Why adding an empty test solved the issue is beyond my understanding.

how did you verify that payload was not hitting the enpoint test script get executed after request flow completes ,

COuld you add more information , i think when there was nothing green in the report you where considering it as sikked request. It most likely that it was indicating no tests where there not that request was skipped

1 Like

I verified it wasn’t hitting the endpoint because it wasn’t showing up in our app. Manual sends did.

this is the response I got from the monitor BEFORE i added the dummy test snippet

this is the response I got AFTER adding the test snippet

You can see I got a 200 response in both, but it was only the second screenshot that actually hit our endpoint. Again, still don’t really understand why the test variable made the difference, but that was literally the only difference between the two attempts.

you can see status code 200 it means the request was send and you got response back , pass is the test in your code which says the test pass .

in first case you didn’t had any tests so no green
in second case you had an empty test with no assertion so you gets green

if you are sure it was not hitting the endpoint can try with some other request and try raising an issue , but most likely it was just misinterpretation could you just cross check again