# How do I print a variable value along with the string in the Test results

**URL:** <https://community.postman.com/t/how-do-i-print-a-variable-value-along-with-the-string-in-the-test-results/22971>\
**Category:** Help Hub\
**Tags:** tests, variables, test-results\
**Created:** [April 22, 2021, 10:08am UTC](https://community.postman.com/t/how-do-i-print-a-variable-value-along-with-the-string-in-the-test-results/22971 "2021-04-22T10:08:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [April 22, 2021, 10:49am UTC](https://community.postman.com/t/how-do-i-print-a-variable-value-along-with-the-string-in-the-test-results/22971/4 "2021-04-22T10:49:20Z")

</div>

Similar topic is discussed [here](https://community.postman.com/t/include-variable-in-pm-test/21937/2). You can use replaceIn as well like,

```auto
pm.test(pm.variables.replaceIn("Response body contains the ID as {{LeadID}}"), function () {
          var jsonData = pm.response.json();
        pm.expect(jsonData.Id).to.eql(pm.environment.get("LeadID"));
    });

```

---

_[View the full topic](https://community.postman.com/t/how-do-i-print-a-variable-value-along-with-the-string-in-the-test-results/22971)._
