添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I am trying to run a collection but before it hits any request, an error comes up saying

Failed running the collection: TypeError: Cannot read properties of undefined (reading 'id')

My only test is

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

The collection runs were working previously and nothing has changed. Why has it stopped working? I can run each request individually. If I restrict the collection run to a single request, it still does not work. What is happening?

What Collections are you running and in what context?

Are you following some training or using the Postman API?

Is there a script that’s doing something with the data?

Hey @darshpreetsingh :wave:t2:

Can you elaborate more on the workflow that you have in your context?

If this is an issue that more people are having, understanding the pattern or similar actions will help us in providing support.

I have set of APIS which have pre requests and post request and that set variables taken from response to get used in following api’s but when running a folder from collection it gives the mentioned error however if I run same folder’s request one by one in sequence then no errors. Issue Resolved after 2 times of restarting system

@darshpreetsingh

If the problem is intermittent and a reboot sorts it, then I can only suggest adding extra console logging to your scripts to work out where the error is happening.

The error is likely to be before the actual line that is generating the error.

A required variable is returning undefined, so you need to track down the part of the code that generates that variable to investigate.

If you set a collection or environment variable. Console log it straight afterwards to ensure its been set.

Just adding to this. I had the exact same issue and error and found this page. Restarting Postman triggered yet another firewall rule prompt and my runner worked fine afterwards with no changes to anything else. Desktop app on win10 had been open for less than a day. I didn’t need to reinstall, but is it possible that the constantly changing firewall signature is part of the issue? Almost every time i start postman recently i get asked to make a new rule by windows.

Hi @danny-dainton,

I faced the same error, to answer a little bit to your previous questions:
“Can you elaborate more on the workflow that you have in your context?”, I’m using the Atlassian’s API collection and tried to run this API https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-groups/#api-rest-api-3-group-user-delete.

I’m using a few variables that were all correctly defined in the CSV I uploaded. No Pre/post-scripts either.

After I closed Postman’s Desktop app, and ended all it’s background tasks and re-launched it, the same Run worked correctly.

Hope this helps.