# Include variable in pm.test

**URL:** <https://community.postman.com/t/include-variable-in-pm-test/21937>\
**Category:** Help Hub\
**Tags:** tests, variables, json\
**Created:** [March 26, 2021, 2:18pm UTC](https://community.postman.com/t/include-variable-in-pm-test/21937 "2021-03-26T14:18:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [March 26, 2021, 2:47pm UTC](https://community.postman.com/t/include-variable-in-pm-test/21937/2 "2021-03-26T14:47:54Z")

</div>

@Col Welcome to the community 🥳

You can try this way:

```auto
pm.test("Status code is 202 " + pm.environment.get("OUTPUT"), function () {

    pm.response.to.have.status(202);
});

```

Change the scope of the variable you have used, if its not environmental variable. Please let me know if you have any issues 🙂

---

_[View the full topic](https://community.postman.com/t/include-variable-in-pm-test/21937)._
