How to run code directly in the console?

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.

Hey @gabriel-r

I donā€™t think currently @postman has support for running script directly within the console but good thought team should take this as a product feature :stuck_out_tongue: . 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

1 Like

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. :trophy:

A browsers dev tools feature isnā€™t really a fair comparison, in my opinion, thereā€™s a helluva lot more going on inside there :smiley:

2 Likes

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!

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.

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 :slight_smile:

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