# AssertionError: expected undefined to equal

**URL:** <https://community.postman.com/t/assertionerror-expected-undefined-to-equal/48030>\
**Category:** Help Hub\
**Tags:** variables\
**Created:** [June 1, 2023, 2:30am UTC](https://community.postman.com/t/assertionerror-expected-undefined-to-equal/48030 "2023-06-01T02:30:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonellapalilla](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@antonellapalilla](https://community.postman.com/u/antonellapalilla)\
**Post date:** [June 1, 2023, 2:30am UTC](https://community.postman.com/t/assertionerror-expected-undefined-to-equal/48030/1 "2023-06-01T02:30:20Z")

</div>

Hi!!! I need Help

i have a GET request which returns:

[  
{  
“ContractorCompanyName”: null,  
“LastName”: “Lopez”,  
“SupervisorTechnicianNum”: “AA23DC”,  
“SignatureCaptureCapableInd”: “Y”,  
“LastLoginDateTime”: “2023-05-29T11:54:07-03:00”,  
“PhoneNum”: null,  
“AltNum”: null,  
“GPSDeviceNum”: “gpsandroid-10106”,  
“licenses”: null,  
“EmployeeId”: null,  
“eCardContactHours”: null,  
“TechnicianNum”: “AQ21SAD007”  
}  
]

I want to add asertion and tried this:

pm.test(“Validar tecnico”, function () {  
var jsonData = pm.response.json();  
pm.expect(jsonData.TechnicianNum).to.equals(“AQ21SAD007”);  
});

But failed, returns this:

AssertionError: expected undefined to equal ‘AQ21SAD007’

Any help please.  
Thank you so much!

---

<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:** [June 1, 2023, 10:07am UTC](https://community.postman.com/t/assertionerror-expected-undefined-to-equal/48030/2 "2023-06-01T10:07:41Z")

</div>

Your response is an array with a single object in it.

Array indexes start at 0.

Therefore it would be…

```auto
pm.test("Validar tecnico", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData[0].TechnicianNum).to.equals("AQ21SAD007");
});

```

---

<div class="post-metadata">

**Author:** ![antonellapalilla](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@antonellapalilla](https://community.postman.com/u/antonellapalilla)\
**Post date:** [June 2, 2023, 7:03pm UTC](https://community.postman.com/t/assertionerror-expected-undefined-to-equal/48030/3 "2023-06-02T19:03:41Z")

</div>

Excellent, it works!!!  
thank you so much
