# How to parametrize the runner's testcase name by csv?

**URL:** <https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720>\
**Category:** Help Hub\
**Created:** [June 3, 2019, 7:37am UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720 "2019-06-03T07:37:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tester20183450](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tester20183450](https://community.postman.com/u/tester20183450)\
**Post date:** [June 3, 2019, 7:37am UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/1 "2019-06-03T07:37:15Z")

</div>

![image](https://us1.discourse-cdn.com/getpostman/original/2X/c/cf0f86cc3291ef6f233de3464adbcd63c3363f63.png)  
The red lines~

---

<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:** [June 5, 2019, 6:34pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/2 "2019-06-05T18:34:39Z")

</div>

Hey @tester20183450,

It’s unclear what you’re asking for here - Would you be able to add more context to the question, please?

---

<div class="post-metadata">

**Author:** ![mahi8321](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mahi8321](https://community.postman.com/u/mahi8321)\
**Post date:** [July 29, 2019, 2:20pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/3 "2019-07-29T14:20:30Z")

</div>

Hi Danny,

I think his question is, how to parametrize the test case name, where it can be uniquely identified.

As per his above report he got multiple iterations with different sets of data, so I believe the test name will be same for all individual iterations, so he want some unique test name for each iteration.

Thanks,  
Mahi

---

<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:** [July 29, 2019, 4:40pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/4 "2019-07-29T16:40:03Z")

</div>

I don’t think that you can currently change that part of the request to make it more dynamic.

As a workaround and really basic way of getting _something_ unique to that dataset, you _could_ add this in that `Test` name,:

```
pm.test(`${pm.info.requestName} - Id: ${pm.iterationData.get('id')}`, function () {
      // Check for something here...
});

```

That would give you the request name and also reference a pre-defined `id` on the column or property of the data file.

One of the clear downsides of this is that if you run the single request in the app, you’re going to have a test name like `GET Request - Id: undefined` returned ☹

It’s not perfect but that _could_ be used to do a quick visual check in the Collection runner?

 ![41](https://us1.discourse-cdn.com/getpostman/original/2X/f/fb6ba14c4e4a377596db8e59e5a2281df6c56a97.png)

---

<div class="post-metadata">

**Author:** ![mahi8321](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mahi8321](https://community.postman.com/u/mahi8321)\
**Post date:** [July 30, 2019, 1:06pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/5 "2019-07-30T13:06:18Z")

</div>

I have a similar question and your solution really helps me, thank you Danny.

---

<div class="post-metadata">

**Author:** ![giuberti](https://avatars.discourse-cdn.com/v4/letter/g/ce7236/32.png) [@giuberti](https://community.postman.com/u/giuberti)\
**Post date:** [August 16, 2019, 8:19pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/6 "2019-08-16T20:19:32Z")

</div>

I think I have this similar issue.  
I’m trying to use some CSV columns to store the expect results for each cenario (csv row).  
It work pretty well to get the data on the body requests, but I’m still working my ass of to make work on the tests scripts.  
I did not found anything on the docs so far

Thanks in advance

---

<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 16, 2019, 9:49pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/7 "2019-08-16T21:49:32Z")

</div>

Hey @giuberti,

Welcome to the community!! ⭐

Could you please show an example of what you’re doing and what’s not working for you.

Might be better with images to explain what’s going on and allow folks to help you out 😁

---

<div class="post-metadata">

**Author:** ![giuberti](https://avatars.discourse-cdn.com/v4/letter/g/ce7236/32.png) [@giuberti](https://community.postman.com/u/giuberti)\
**Post date:** [August 19, 2019, 12:59pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/8 "2019-08-19T12:59:11Z")

</div>

Hey @dannydaiton,

I´m using a simplified project to make these tests.  
I´m basically trying to use the csv columns (in my example, [cenario] and [acaoEsteira]) to validate my tests.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/d/3d005ba0055d201346811559928fa09e6b58f56b.png)

All columns work pretty fine on the request body.

But, i´m trying to use both also on the Tests scripts, like above:

![image](https://us1.discourse-cdn.com/getpostman/original/2X/f/f2a74660ed37df934bfbac3b8a8ebe518722b955.png)

And it do not work. As the way above I get only as string.

![image](https://us1.discourse-cdn.com/getpostman/original/2X/f/f96086247ae281e3d7fc2d833a3d57b7bee847c7.png)

If I try to get them as pm.global (or pm.enviroment) I get a previoslly stored value, or undefined.

I´ve also tried to use some pm.interationData, as showed here, but it do not work.

I´m using the lastest version (7.5.0)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![singhsivcan](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/singhsivcan/32/1595_2.png) [@singhsivcan](https://community.postman.com/u/singhsivcan)\
**Post date:** [August 19, 2019, 1:38pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/9 "2019-08-19T13:38:10Z")

</div>

The curly braces syntax is not for the test scripts, the variables won’t be automatically resolved.

You need to use the variables API to access the variables in the scripts.

You can write one of the following:

```javascript
let cenario = pm.iterationData.get('cenario');

```

or

```javascript
let cenraio = data['cenario'];

```

* * *

Also, for globals and environments, you can use their API’s i.e `pm.environment.get('key')` and `pm.globals.get('key')`.

**Docs:**

- [Postman Sandbox API reference](https://learning.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference/)

- [Variables Docs](https://learning.getpostman.com/docs/postman/environments_and_globals/variables/)

---

<div class="post-metadata">

**Author:** ![giuberti](https://avatars.discourse-cdn.com/v4/letter/g/ce7236/32.png) [@giuberti](https://community.postman.com/u/giuberti)\
**Post date:** [August 19, 2019, 3:29pm UTC](https://community.postman.com/t/how-to-parametrize-the-runners-testcase-name-by-csv/5720/10 "2019-08-19T15:29:18Z")

</div>

Hello @singhsivcan,  
now it work pretty well. I used iterationData correctally this time.

Thank you guy so much!  
Greetings
