# Possible to run the same tests for multiple collections within the same Workspace?

**URL:** <https://club.ministryoftesting.com/t/possible-to-run-the-same-tests-for-multiple-collections-within-the-same-workspace/62569>\
**Category:** Discussions\
**Tags:** api-testing\
**Created:** [28 September 2022 20:04 UTC](https://club.ministryoftesting.com/t/possible-to-run-the-same-tests-for-multiple-collections-within-the-same-workspace/62569 "2022-09-28T20:04:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![callmee](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/callmee/32/10792_2.png) [@callmee](https://club.ministryoftesting.com/u/callmee)\
**Post date:** [28 September 2022 20:04 UTC](https://club.ministryoftesting.com/t/possible-to-run-the-same-tests-for-multiple-collections-within-the-same-workspace/62569/1 "2022-09-28T20:04:39Z")

</div>

I’m testing multiple collections in Postman. Each collection includes at least 30+ endpoints. Is it possible to execute the same tests for multiple collections at the same time within the same Workspace?

I’ve tried adding multiple collections to a Runner, but the runner only holds 1 collection at a time. Combining collections into one isn’t ideal because we’d like to keep the services/APIs collections separate.

After doing some ‘Googling’, it seems like we’re only able to create tests at the Collection level then just copy/paste the tests to each different Collection. But I wanted to check with this group in case anyone had some hacks for doing this 😃

Thanks!

---

<div class="post-metadata">

**Author:** ![kristof](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/kristof/32/10839_2.png) [@kristof](https://club.ministryoftesting.com/u/kristof)\
**Post date:** [29 September 2022 08:18 UTC](https://club.ministryoftesting.com/t/possible-to-run-the-same-tests-for-multiple-collections-within-the-same-workspace/62569/2 "2022-09-29T08:18:18Z")

</div>

> [@callmee](#):
>
> But I wanted to check with this group in case anyone had some hacks for doing this

Write all your tests and store them in a variable using the first collection pre-request script.

In all of the other collections, you just get your variable and run those tests.

Pre-request script:

```auto
var assertionTests = () => {

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

pm.globals.set("validationTests", assertionTests.toString());

```

Test Script:

```auto
eval(pm.globals.get("validationTests"))();

```

---

<div class="post-metadata">

**Author:** ![restertest](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/restertest/32/9342_2.png) [@restertest](https://club.ministryoftesting.com/u/restertest)\
**Post date:** [29 September 2022 12:06 UTC](https://club.ministryoftesting.com/t/possible-to-run-the-same-tests-for-multiple-collections-within-the-same-workspace/62569/3 "2022-09-29T12:06:20Z")

</div>

You can try a mini hack depending on the amount of times you want to run the collections.  
You can schedule Jobs in the Monitoring section, one job per collection to start at the same time.  
There is however a limit per month but it may help.

---

<div class="post-metadata">

**Author:** ![callmee](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/callmee/32/10792_2.png) [@callmee](https://club.ministryoftesting.com/u/callmee)\
**Post date:** [29 September 2022 17:46 UTC](https://club.ministryoftesting.com/t/possible-to-run-the-same-tests-for-multiple-collections-within-the-same-workspace/62569/4 "2022-09-29T17:46:54Z")

</div>

Thanks for the tip, Kristof!

---

<div class="post-metadata">

**Author:** ![callmee](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/callmee/32/10792_2.png) [@callmee](https://club.ministryoftesting.com/u/callmee)\
**Post date:** [29 September 2022 17:47 UTC](https://club.ministryoftesting.com/t/possible-to-run-the-same-tests-for-multiple-collections-within-the-same-workspace/62569/5 "2022-09-29T17:47:31Z")

</div>

Hi Ioan,

I’m not familiar with the monitoring section, but I’ll also look into this. Thank you!
