When running collection via Postman Runner it fails, but when I send the requests sequentially in the same folder everything works as expected

In the collection the first request uploads photo, then the second one should take some data from the firs request’s response.
So when I run the collection via Runner it fails to upload photo and consequently the second request fails again as the photo is not uploaded.
The screenshot of console log is attached

!
But when I open the collection and send the same requests manually everything works correct.
What is the problem ?
Thanks in advance

What response are you getting from your upload photo request?

Screenshot at Dec 13 18-56-57

How are you passing the photo content to the request? Is it via an environment variable?

If it is in an environment variable, are you using the correct environment in the collection runner?

No. I upload photo (.jpg) in body as file from computer.

When I send the request manually I receive the expected response. - photo uploads correctly but when I run the collection I am receiving the response that showed above.

I don’t think the issue is linked with environment.

1 Like

I am trying to understand something here.

  1. what kind of api are you using that uploads Photo? any examples will help? like flickr
  2. Check the request/response time of first request you made manually and same time variables when you run in collections?

I feel uploading photo to some server will take time based on the size of photo and other factor.

This is the API:

POST - {{url}}/photos/add.json?key={{json_key}}
Body - file

This is the time of first sent request (sent manually) - Time :2126 ms, 200 OK (file uploads)

This is the time of sending the same request automatically (via Runner) - Time: 427 ms, 400 Bad Request

In console logs I see this message when running the request automatically.
Seems there is problem with file uploading

this is response:
2

I am facing same issue too. while running individually it works fine but when I run it via runner it fails on same request.

This is the response body
code": “500 INTERNAL_SERVER_ERROR”
Invalid JSON input: Cannot deserialize value of type java.lang.Long from String

Same issue here. When I send the requests manually it works. When I run them through Collection Runner, I don’t get the same result. What does Collection Runner do differently?

Hey @aurelien_boubennec,

Welcome to the community! :star:

Are you able to show and describe your particular issue, please?

As much as things seem similar, there will be a difference in what you’re doing compared to others who have seen a similar issue. :smiley:

I’m sure we can take a look at your issue and sort it out together :trophy:

I’m having the exact same issue described above. In the builder I can manually send a request which POSTs an image. To do so, I went to the body of the request, changed the key type to “file” and then clicked “select file”. Manually sending this request works flawlessly.

If I run the same request in the runner, it fails (presumably because the image is not being sent) Do I need to do anything special for the runner to use the image that I chose in the builder?

You need to make sure your file is in the working directory. You can look at where that is by going to settings (ctrl+,) and referencing the configuration.

9 Likes

Perhaps a timing problem. I’m not sure what capabilities the Runner had in Dec '19, however now there is a Delay (ms) field that waits after each call.

The issue is that the runner does not support uploaded images. You have to use Newman to run a test suite that includes an uploaded image…

It solves the problem.
Tks!

1 Like

I had the same issue running it by itself worked, but running it in the runner I got that same error. Putting the files in the working directory worked running in the Runner

This helped me too to get unblocked on a file upload operation!

1 Like

I am having the same problem, but I’m not trying to add a file. I am just trying to validate the 200 status error code. It works when running manually, but does not work when I run as a collection.

pm.test(“Status code is 200”, function () {
pm.response.to.have.status(200);
});

When I run as a collection, I receive …
“Status code is 200 | AssertionError: expected response to have status code 200 but got 500”

At one time this test worked, I know I exported the test results, but not sure if that changed anything.

Plz help.

Sorry, the problem was mine. Fixed problem.

I am also facing the same issue, when I send the get requests manually it works. When I run them through Collection Runner I am getting an error “TypeError: Cannot read properties of undefined (reading ‘quotes’)”. I am storing the values in environment variable from previous request and passing the same variable in this request.