How to run collection with postman free version?

Hi,
I have a collection which contains several requests.
I want to run the collection.

I tried with Run button in postman:
it returns runtime:extensions-request: reuqets url is empty in my first request but i have the url in the first request.

I tried with javascript code:
first exported the collection to collection id
the i used it in my code

var collectionId = ‘your_collection_id’;
var iterations = 1;
var collection = pm.collection.get(collectionId);
if (collection) {
for (var i = 0; i < iterations; i++) {
collection.requests.forEach(function(request) {
pm.sendRequest(request, function(err, response) {
console.log(response);
});
});
}
} else {
console.log(‘Collection not found’);
}

It returns TypeError: Cannot read properties of undefined (reading ‘get’)

  • Platform Details:
    Postman App: Postman free version without sign in
    System version: windows 11

Can you provide a screenshot of the error, and screenshots of the request that you think is causing the error.

Hi,
please find the screenshot of the error.

I’m not really sure what you’re trying to do here - Can I ask where you got that code snippet from?

What’s the overall goal here? Just to run a Collection?

Could you not use the Collection Runner to run a single iteration of the Collection?

The code does look strange.

You get a single collection, by its ID.

Which will return a JSON representation of that collection.

What is the loop meant to be doing? I’m guessing you want to potentially loop through each request in the collection. The JSON representation of the collection will not be in the correct format for you to just pass it to pm.sendRequest. You will need to parse the response, target the loop at the correct element in the collection JSON, and then pull out the relevant data that is needed to make a request.

As Danny has mentioned, why can’t you just use the collection runner?

I’m not entirely sure where you have seen pm.collections.get() being used?

The error message that you can see in the response section is due to it not actually being a usable function in the pm.* API. :thinking:

Hi,

here are my answers:
I’m not really sure what you’re trying to do here:
like the title i want to run a collection in free version of postman.

Can I ask where you got that code snippet from?
from me.

What’s the overall goal here? i want to run all request from the collection.
Just to run a Collection? Yes

Hi,
here is my answer:
As Danny has mentioned, why can’t you just use the collection runner
I m using postman without sign in, without any account.
In this version when i click on run it says i have to sign in, this is what i don’t to do.
So think without an account we cannot run a collection (run all requests in one time, instead of running them one by one)

Is there a reason for not wanting to sign up for a free account and just use the Collection Runner?

You basically have one anyway, by being able to create a new topic on this Community Forum.

I have one for my personal use but not for professional use as this tool is in evaluation for now.

There is more than just the request that goes into a collection.

If you are using the authorization helpers, then the collection JSON will have auth details.

You have the details in the pre-request script and tests tab. Collection variables, etc.

You can’t just take the collection JSON and run it using sendRequest().

The only real way to run or even develop a collection is to sign in.

I’m assuming you must be using a old version of the client, as you need to sign in to even access the collections in the current versions.

You have the lightweight client for those who don’t want to login, but that will only allow you to make individual requests. It won’t allow you to run collections.

So clearly without sign in it won t allow to run collection.
So will look later then
thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.