# How to run code directly in the console?

**URL:** <https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837>\
**Category:** Help Hub\
**Tags:** tests, console\
**Created:** [August 17, 2021, 5:09pm UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837 "2021-08-17T17:09:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel-r](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@gabriel-r](https://community.postman.com/u/gabriel-r)\
**Post date:** [August 17, 2021, 5:09pm UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837/1 "2021-08-17T17:09:42Z")

</div>

I’m not really just starting but I never found how to do this basic task, so here goes…

Is there a way to run code directly in the Postman interface, like one can do it a browser Dev Tool pane? I need to do some quick manipulations with my environment variables and don’t want to create a fake request for it.

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/2/22ef61b90a2542381da6ce07c1c78bada91707d3.jpeg)

---

<div class="post-metadata">

**Author:** ![vikram.sahu](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vikram.sahu/32/5449_2.png) [@vikram.sahu](https://community.postman.com/u/vikram.sahu)\
**Post date:** [August 18, 2021, 2:50pm UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837/2 "2021-08-18T14:50:12Z")

</div>

Hey @gabriel-r

I don’t think currently [@postman](https://community.postman.com/groups/postman) has support for running script directly within the console but good thought team should take this as a product feature 😛 . For now, only you can search and track your logs, warnings, and errors.

Still just for confirmation @neilstudd or @danny-dainton can share their views.

Best,  
Vikram

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [August 18, 2021, 3:33pm UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837/3 "2021-08-18T15:33:55Z")

</div>

No, that’s not currently something that is supported. I don’t think that it’s even something that would be supported any time soon. Feature requests are always welcome though. 🏆

A browsers dev tools feature isn’t really a fair comparison, in my opinion, there’s a helluva lot more going on inside there 😃

---

<div class="post-metadata">

**Author:** ![gabriel-r](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@gabriel-r](https://community.postman.com/u/gabriel-r)\
**Post date:** [August 18, 2021, 5:07pm UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837/4 "2021-08-18T17:07:39Z")

</div>

Hi Danny  
the whole dev tools with a kitchen sync would be overkill indeed, but a tiny field to run whatever “in the console” would be super useful. At least I think so, maybe it’s just me.  
Thanks!

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [August 18, 2021, 5:28pm UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837/5 "2021-08-18T17:28:41Z")

</div>

I don’t doubt it would be useful to some folks but the console, in the Postman context, is more of an output display source rather than a scripting environment.

---

<div class="post-metadata">

**Author:** ![pranavdavar](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/pranavdavar/32/9152_2.png) [@pranavdavar](https://community.postman.com/u/pranavdavar)\
**Post date:** [August 19, 2021, 4:48am UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837/6 "2021-08-19T04:48:26Z")

</div>

I generally write code in pre-requisite scripts and point the request to localhost invalid url.

to check the output of script I use console.log();

In this way I am able to test code, before writing it to actual test scripts.

Hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [August 19, 2021, 8:28am UTC](https://community.postman.com/t/how-to-run-code-directly-in-the-console/26837/7 "2021-08-19T08:28:19Z")

</div>

Using the `Postman Echo` service to make ‘dummy’ requests is another option:

[https://www.postman.com/postman/workspace/published-postman-templates/collection/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65?ctx=documentation](https://www.postman.com/postman/workspace/published-postman-templates/collection/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65?ctx=documentation)
