Postman New UI 8.0.3 Where did the "Count" go?

I have just recently Updated my Postman Version to 8.0.3 and got the “New UI”

I the previous versions the there was a “Count” of the number of requests that were contained within a Collection that showed up adjacent to the collection name.
image
I’m not seeing this count any more.
image
Did this get Moved?

  • If so where too?

Deprecated?

  • I hope not as we used this as part of our Management of close to 7000 requests in 29 collections that we run on a daily basis.
  • if this is the case is there an “easy” way to get a count of the number of requests in a collection without actually “Counting” them one by one. We use a multi level request set structure that would make this very tedious and time consuming.
5 Likes

I agree. It was a useful feature. Any chance we could get the count back? Or an option to turn it on.

Hey @ScottTaylor1986 / @allen888 :wave:

This was removed as part of the major UI update that came with the V8 release, we are listening to this feedback and the team is working on adding this information back into the new UI. :heart:

No timelines available for this work yet.

4 Likes

we need this back, please!
It contains a valuable information,
thanks!
Is there a way to get this info somehow in Postman 8?

Just checking in here;
Is there another way to get this info?

Depending upon your needs, one way that you could to this would be to utilise the Postman API itself, which (when authenticated) allows you to retrieve data about your collections.

If you perform a Single Collection request (specifying the ID of your collection) then you can add code such as the below into its Tests tab. This will recursively loop through all of the items in the collection (including subfolders) and extract a total count of the requests within the folder.

function countRequests(obj) {
  for (let item in obj) {
    if(obj[item].hasOwnProperty("request")) {
        requestCount += 1;
    } else {
        countRequests(obj[item].item);
    }
  }
}

var requestCount = 0;
countRequests(pm.response.json().collection.item);
console.log("Collection contains " + requestCount + " requests");

When I run this script against one of my collections, I see the correct number output in the console:

I appreciate that this is just a workaround, but I hope this may still help. :rocket:

Thank you neilstudd. I am trying to run this code
I am getting this error in console
“TypeError: Cannot read property ‘item’ of undefined”

Hi @sherry.key,

Can you check the Body tab of the response, to ensure you have successfully loaded your collection data?

If the data failed to load (such as below, where I had not successfully authenticated with the endpoint) then the test script would fail, because it cannot find the collections data in the response.

If you have successfully retrieved the details of a single collection, the response will begin like the below, and the script should complete successfully:

Neil, I receive the correct response but it does not have requests

“collections”: [

{

“id”: “”,

“name”: “Extras”,

“owner”: “”,

“createdAt”: “2021-08-17T17:48:53.000Z”,

“updatedAt”: “2021-08-17T18:06:26.000Z”,

“uid”: “”,

“isPublic”: false

},

Your code is looking for request and it is not returned. Is that expected?

pm.test(function countRequests(obj) {

for (let item in obj) {

if(obj[item].hasOwnProperty(“request”)) {

requestCount += 1;

} else {

countRequests(obj[item].item);

Hi @sherry.key,

Your response is returning “collections” rather than “collection” - this indicates that it is trying to return all of your collections. (The list of all collections does not include details of the individual requests within.)

You should ensure that your collection ID is being set correctly in the request URL (either by setting it within a variable, or by hardcoding in the URL). This should ensure that you get “collection” back in the response, which will contain full details of all the sub-requests.

Thank you @neilstudd !
Got it working!

It seems Single Collection request Resource is no longer available.

Can you please suggest a workaround ?

@ shyam.suchak

I’m still seeing it under the Postman API Collection:
Collections - Postman Public Workspace

I use this bit of code in the tests to add the Collection name to the count written to the console

 function countRequests(obj) {
    for (let item in obj) {
        if (obj[item].hasOwnProperty("request")) {
            requestCount += 1;
        } else {
            countRequests(obj[item].item);
        }
    }
}

var currentCollectionName = (pm.response.json().collection.info.name);
pm.environment.set("currentCollectionName", pm.response.json().collection.info.name);
var requestCount = 0;
countRequests(pm.response.json().collection.item);
console.log("Collection " + pm.environment.get("currentCollectionName") + " contains " + requestCount + " requests");

pm.environment.unset("currentCollectionName");
pm.environment.unset("collection_uid");

I’m using a pre-request script to populate the “collection_uid” Variable

I’m running this periodically to get the counts for 33 collections that we run for our API Automation.

1 Like

Apologies, as @allen888 has highlighted, the URL for that specific request has changed - I’ve updated the direct link in the original post.