Hi. I have a post api that uploads a document.
When i run it manually the tests pass but when i run it in the collection runner it fails and gives 500 internal server error.I am setting the environment to be correct on the collection runner and i have saved. Please looking for assistance.Thanks
Hi there.
Seems you are executing a request with a file. Have you included this file into the collection runner?
Welcome to the community, @vikash.chetty!
The fix is easy, but not very obvious.
If you open up Postman settings (ctrl + ,) and scroll down down the Working Directory section and look at the folder in the Location field.
You need to put the file you’re uploading in that directory, that way Postman knows where to pull it from when using the collection runner.
I am facing the same problem. Placing a file into the working directory did not solve the problem for me.
There seems to be multiple users having the same problem as there are many related postings on this issue and no real clear answer - other than putting the file in the working directory - and that unfortunately does not work.
I have seen some comments that you have to use something called Newman to successfully upload files but no good clear directions on how that is accomplished.
Any help would be appreciated.
How are you adding files in the postman request?
Hi Allen, I am using the POST body - where I specify File in the Key column and then select the file from the drop down in the Value column.
Works fine in the main postman work area - but not when used in the Runner.
I am using the same way to add files in a POST request i.e. “specify File in the Key column and then select the file from the drop down in the Value column”.
File is also copied to working directory location.
But the POST request still fails when executed using runner and successful when executed individually.
Is there any workaround?
Postman v9.3.0
Below the location field there is an option that says ‘Allow reading files outside working directory’. This will be disabled by default. You can enable this and try. The collection runner will successfully even when the files are not placed in default location
Thank you, this works for me.
In my case, the problem was that the Excel file I used contained a date in the wrong format. It took a while for me to find this error. I corrected the format in Excel and then the Collection Runner worked flawlessly.
I’m having this same issue on some very simple tests. Manual runner of all the tests passes but the scheduled runner fails.
It appears to have to do with using a variable to save a password. Hard coding the password allows all tests to pass, but using a variable in either collection, environment, or global does not pass.