# How do I write test for a single request with different data?

**URL:** <https://community.postman.com/t/how-do-i-write-test-for-a-single-request-with-different-data/8868>\
**Category:** Help Hub\
**Tags:** tests, collections\
**Created:** [November 8, 2019, 8:20am UTC](https://community.postman.com/t/how-do-i-write-test-for-a-single-request-with-different-data/8868 "2019-11-08T08:20:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leen](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@leen](https://community.postman.com/u/leen)\
**Post date:** [November 8, 2019, 8:20am UTC](https://community.postman.com/t/how-do-i-write-test-for-a-single-request-with-different-data/8868/1 "2019-11-08T08:20:30Z")

</div>

I want to test my API with two or more different types of body structures and write corresponding tests for each.  
How can I achieve that?

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [November 8, 2019, 9:58am UTC](https://community.postman.com/t/how-do-i-write-test-for-a-single-request-with-different-data/8868/2 "2019-11-08T09:58:32Z")

</div>

Hey,

They are plenty of resources to learn how to achieve that. The main one would be on the Learning Center:  
[https://learning.getpostman.com/docs/postman/scripts/test-scripts/](https://learning.getpostman.com/docs/postman/scripts/test-scripts/)

If you’re new to Postman I’d also recommend going through these two video series:

> **[How to Use Postman: The Fundamentals \[Video\] | POST/CON 2019 | Postman](https://www.postman.com/post-con-2019/how-to-use-postman/)**
>
> In this comprehensive workshop Johnny Tu, Senior Trainer at ServiceRocket, will be covering all the basics of Postman.

> **[How to Use Postman for Experts \[Video\]](https://www.postman.com/post-con-2019/how-to-use-postman-for-experts/)**
>
> In this comprehensive workshop Johnny Tu, Senior Trainer at ServiceRocket, will be covering some more advanved concepts of Postman

---

<div class="post-metadata">

**Author:** ![Ray](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/ray/32/3236_2.png) [@Ray](https://community.postman.com/u/Ray)\
**Post date:** [November 13, 2019, 6:10pm UTC](https://community.postman.com/t/how-do-i-write-test-for-a-single-request-with-different-data/8868/3 "2019-11-13T18:10:42Z")

</div>

@leen please provide sample request/response so we can help you.

---

<div class="post-metadata">

**Author:** ![singhsivcan](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/singhsivcan/32/1595_2.png) [@singhsivcan](https://community.postman.com/u/singhsivcan)\
**Post date:** [November 14, 2019, 11:44am UTC](https://community.postman.com/t/how-do-i-write-test-for-a-single-request-with-different-data/8868/4 "2019-11-14T11:44:06Z")

</div>

Duplicate of - [How do I write test for same request with different body?](https://community.postman.com/t/how-do-i-write-test-for-same-request-with-different-body/8976/2)

---

<div class="post-metadata">

**Author:** ![singhsivcan](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/singhsivcan/32/1595_2.png) [@singhsivcan](https://community.postman.com/u/singhsivcan)\
**Post date:** [November 14, 2019, 11:44am UTC](https://community.postman.com/t/how-do-i-write-test-for-a-single-request-with-different-data/8868/5 "2019-11-14T11:44:10Z")

</div>

Closed on November 14, 2019, 11:44am UTC


