11

How can I ask for user input in Postman scripts?

I am using Postman 4.8.3, Chrome app. I have used environment variables in most cases, but for a particular case I need user to provide input for each run (I am not running collection. Instead want to make the individual Postman call more interactive as I am dealing with some management APIs). I want to insert a code like:

prompt("Enter resource id","#id");

in the Pre-request Script. However, when I do so, Postman ignores it and moves ahead. Please help.

TechiRik
  • 1,893
  • 6
  • 27
  • 37
  • https://github.com/postmanlabs/postman-app-support/issues/285 This is not allowed by Chrome apps. So what you are attempting is not possible. –  Nov 19 '16 at 20:57

2 Answers2

6

As stated by another, Chrome extensions reportedly doesn't allow prompt. BUT there are now native versions of Postman (Windows, Mac, Linux) and according to this nearly four year old feature request, they are working on this and will post to the request when the ability to prompt is in the Canary version.

Kevin Dorff
  • 61
  • 1
  • 2
0

I dont believe this feature is available as of today too. Unless you can use the Path variables or query parameters

Prasanth J
  • 1
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 10 '21 at 15:52