# ReferenceError error: json is not defined

**URL:** <https://community.postman.com/t/referenceerror-error-json-is-not-defined/43422>\
**Category:** Help Hub\
**Tags:** tests, scripts\
**Created:** [February 1, 2023, 12:06am UTC](https://community.postman.com/t/referenceerror-error-json-is-not-defined/43422 "2023-02-01T00:06:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![francisacobahena](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@francisacobahena](https://community.postman.com/u/francisacobahena)\
**Post date:** [February 1, 2023, 12:06am UTC](https://community.postman.com/t/referenceerror-error-json-is-not-defined/43422/1 "2023-02-01T00:06:57Z")

</div>

I’m wanting to automate my tests but when I run my tests I get this error

 ![Screenshot_7](https://us1.discourse-cdn.com/getpostman/original/3X/a/4/a449a8ed3fc08423c855e4e4aa384d7f899094e9.png)

this is the test i am running

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

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 1, 2023, 11:02am UTC](https://community.postman.com/t/referenceerror-error-json-is-not-defined/43422/2 "2023-02-01T11:02:01Z")

</div>

This line is incorrect.

```auto
pm.expect(json.Data[0].profileId).to.eqls(profileId);

```

You have parsed the response to the variable jsonData (not json.Data).

Get used to console logging your variables for troubleshooting purposes, so you know they are being targeted correctly.

You can remove all of the console logs after you get the code working.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [January 19, 2024, 3:38pm UTC](https://community.postman.com/t/referenceerror-error-json-is-not-defined/43422/3 "2024-01-19T15:38:10Z")

</div>

Closed on January 19, 2024, 3:38pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
