# Executing multiple API's inside one Collections under tests tab

**URL:** <https://community.postman.com/t/executing-multiple-apis-inside-one-collections-under-tests-tab/23848>\
**Category:** Help Hub\
**Tags:** postman, postman-api\
**Created:** [May 18, 2021, 1:27pm UTC](https://community.postman.com/t/executing-multiple-apis-inside-one-collections-under-tests-tab/23848 "2021-05-18T13:27:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashzode](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/yashzode/32/8562_2.png) [@yashzode](https://community.postman.com/u/yashzode)\
**Post date:** [May 18, 2021, 1:27pm UTC](https://community.postman.com/t/executing-multiple-apis-inside-one-collections-under-tests-tab/23848/1 "2021-05-18T13:27:13Z")

</div>

Please assume,

Name of collection is “Fruits.”  
sub folders inside collection with 3 request

1. get fruit by mango
2. get fruit by apply
3. put Update fruit by name.

is there any way , that we can execute all the 3 API in one request and if one of the API’s fail then “Fruits” is failed.

I have tried to use pre-request scripts tab and added all the 3 API using pm.sendRequest() , but when i execute it , postman ask me to add one API request compulsory .

---

<div class="post-metadata">

**Author:** ![yashzode](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/yashzode/32/8562_2.png) [@yashzode](https://community.postman.com/u/yashzode)\
**Post date:** [May 18, 2021, 4:29pm UTC](https://community.postman.com/t/executing-multiple-apis-inside-one-collections-under-tests-tab/23848/2 "2021-05-18T16:29:23Z")

</div>

I Have Solved it,  
Thank You.

---

<div class="post-metadata">

**Author:** ![meenakshi.dhanani](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/meenakshi.dhanani/32/5980_2.png) [@meenakshi.dhanani](https://community.postman.com/u/meenakshi.dhanani)\
**Post date:** [May 19, 2021, 11:15am UTC](https://community.postman.com/t/executing-multiple-apis-inside-one-collections-under-tests-tab/23848/3 "2021-05-19T11:15:57Z")

</div>

Hey @yashzode,  
Could you share what worked for you? It could help folks having a similar question or facing a similar issue.

---

<div class="post-metadata">

**Author:** ![yashzode](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/yashzode/32/8562_2.png) [@yashzode](https://community.postman.com/u/yashzode)\
**Post date:** [May 19, 2021, 12:39pm UTC](https://community.postman.com/t/executing-multiple-apis-inside-one-collections-under-tests-tab/23848/4 "2021-05-19T12:39:10Z")

</div>

Yes Sure, @meenakshi.dhanani  
I am happy to support.  
My mail id: [zodeyash@gmail.com](mailto:zodeyash@gmail.com)

Solution:

I have validated each request using json schema and added it to collection variable.  
Similarly for response code.

At the last of the request ,  
Under the test tab, I am calling each collection variable and checking if everything is good or not good.  
If everything is good then, pm.response.

If one of them is not good then ,

tests["collection name - expecting ABC | actual recieved xyz]=false;

Also I have used array , if there are multiple failures then it will push it into array.  
Example: array.push(“expected … actual…”);  
Then just write,  
test[“collection name”+array]=false

As I export this postman collection  
with the help of newman I am now able to upload into zephyr jira.
