Postman request failing with runner, but works manually

I’m using Postman to test our API,
I run a bunch of various requests and they all work manually. If I try use the runner to run the entire collection this 1 delete request always fails (error 405 method not allowed), but it works manually if I run it right after it fails.

My guess is that it has to do with the order you are building up your variables.

In the runner, it might be looking for a variable that doesn’t exist or is incorrect.

When running manually, maybe you executed the requests in a different order or set the variable manually?

Double checked, and it’s not that. No params, and body is empty, the only variables are the environmental variables, {{ElementID}} and {{InitID}} (passed in URL), both are defined before this step. {{ElementID}} is returned in the test from “Post Create Element1” and {{InitID}} is returned from “Post Create Initiative”. Both are used before it gets stuck.

Looking at your workflow here, maybe you are using the wrong variable to link the initiative?

image

I see you’re linking the iniative you created to ElementID2 but you are trying to delete it from ElementID

When I create the initiative it gets linked to Element (the post request in your pic has ElementID), I then also link it to Element2, and then try unlink it from element1, which is where the issue arises.

I was really hoping that was it :slight_smile:

Unfortunately I am out of ideas. It looks like you’re doing everything right - things seem to be configured properly in Postman. Right now my inclination is to say it might be an issue with the API?

I don’t know what tech stack that API is built on, but it’s a possibility it could be an eventual consistency issue. Maybe you try adding a few second delay in your collection to give it some time to do any async processing?

You could just add a request to the postman echo delay endpoint: GET https://postman-echo.com/delay/5. This would add a 5 second delay. Documentation here

That did it thanks. I had to increase the delay to 200ms though.

Strangely I was getting the same error in a different collection (SX - delete), but the problem isn’t fixed there if I add the delay

1 Like

Maybe a longer delay is necessary?

I’ve tried with a delay of 2000 and still nothing, in the mean time I removed the delay from the “Sx - create” collection and it still runs with no errors (also after reloading postman).
Maybe we’re barking up the wrong tree with the delay,

  • but I haven’t changed anything else, so not sure why it’s now working.