1

How To dynamic the Postman Request name from reading the CSV?

  1. We have one request in postman collection and we are trying to run with the external data source (CSV) with different scenarios added in that.
  2. CSV contains the following fields (Test ID, TestCaseDescription, METHOD, url, Requestbody parameter1, Requestbody parameter2,....Requestbody parameter->n)
  3. When we run this and see the report in Newman or postman runner it shows the same Request name for different scenarios performed from CSV data set. 4.so we tried to dynamic the request name by mapping the TestCaseDescription as a Variable in curly brassies "{{}}". but it did not work for us. Please Refer a attached screenshot

Can anyone please help us out on this.

Mitul Parekh
  • 151
  • 1
  • 8
  • The name field only uses plain text and the description field is markdown so you wouldn't be able to the `{{...}}` syntax, you also cannot dynamically change the name via a script or data file. The data file enables you to iterate through the same request with different data sets so it would be the same request name. Are you able to add an identifier somewhere else? In the Test name etc. – Danny Dainton Jan 21 '20 at 11:15
  • We are not able to add any such identifier for now but is there a way to do that? Or an alternate approach to achieve what we are trying to do? – Mitul Parekh Jan 21 '20 at 12:12
  • Not in the way that you're trying. There are only certain places in the app that will allow you to use variables, the Request name is not one of those places. – Danny Dainton Jan 21 '20 at 12:14
  • We Tried with following conditions in Pre-Request-Script console.log("## ",request.name); console.log("$$$ ",data.TestCaseDescription); request.name=data.TestCaseDescription; console.log("NEW ## ",request.name); We could able to see in Console the request name is getting the TestCaseDescription from the CSV, but not in the actual result. Is there any workaround with that or any other solution if you could suggest? – Mitul Parekh Jan 21 '20 at 12:34
  • You will not be able to change the request name. it's just not something that you can change programmatically so all the ways you try and do it will not work. All that you're doing there is changing a local variable to the data file value of the description. – Danny Dainton Jan 21 '20 at 12:45

0 Answers0