# Pm.test with variables in testName?

**URL:** <https://community.postman.com/t/pm-test-with-variables-in-testname/4020>\
**Category:** Help Hub\
**Created:** [February 4, 2019, 7:36pm UTC](https://community.postman.com/t/pm-test-with-variables-in-testname/4020 "2019-02-04T19:36:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarinFrazier](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@DarinFrazier](https://community.postman.com/u/DarinFrazier)\
**Post date:** [February 4, 2019, 7:36pm UTC](https://community.postman.com/t/pm-test-with-variables-in-testname/4020/1 "2019-02-04T19:36:44Z")

</div>

I’m testing nested array and would like to know at what intersection they pass / fail.  
a = first level array (from a for loop)  
b = nested array (from b for loop)

looking to get test output like:  
pm.test(“At a step b is not NULL”, function () {

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![dave](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dave](https://community.postman.com/u/dave)\
**Post date:** [February 5, 2019, 4:50pm UTC](https://community.postman.com/t/pm-test-with-variables-in-testname/4020/2 "2019-02-05T16:50:36Z")

</div>

pm.test(`At ${a} step ${b} is not NULL`, function() {

Interpolation requires backticks (`) around the text you want to use.

You can always use the old way of concatenation, but it’s ugly and sucks to write.

pm.text(“At " + a + " step " + b " + " is not NULL”, function() {

---

<div class="post-metadata">

**Author:** ![postman-paul540](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/postman-paul540/32/149_2.png) [@postman-paul540](https://community.postman.com/u/postman-paul540)\
**Post date:** [February 6, 2019, 10:45am UTC](https://community.postman.com/t/pm-test-with-variables-in-testname/4020/3 "2019-02-06T10:45:55Z")

</div>

I used to do this and I would advise against it.

It becomes a headache when debugging if those values/properties aren’t present in the response because the test name would show:

```auto
"At undefined step undefined is not NULL"

```

---

<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:** [February 6, 2019, 12:40pm UTC](https://community.postman.com/t/pm-test-with-variables-in-testname/4020/4 "2019-02-06T12:40:36Z")

</div>

I agree with Paul, I have suggested doing this in the past but for values that I _know_ that were going to be there. Gets a bit messy when you are trying to do something like this with it.
