# AssertionError: expected ' ' to deeply equal

**URL:** <https://community.postman.com/t/assertionerror-expected-to-deeply-equal/22977>\
**Category:** Help Hub\
**Tags:** tests, variables, collections, json\
**Created:** [April 22, 2021, 12:55pm UTC](https://community.postman.com/t/assertionerror-expected-to-deeply-equal/22977 "2021-04-22T12:55:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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, 2:14pm UTC](https://community.postman.com/t/assertionerror-expected-to-deeply-equal/22977/2 "2021-04-22T14:14:13Z")

</div>

Hi @jagrutiwani0, this error is because you are comparing two different data types. Even the value is same here the data type is different.

So while storing the collection variable you can store using JSON.stringify() method,

else you can convert it to integer like this [post](https://community.postman.com/t/how-can-postman-compare-the-value-of-a-written-variable-with-the-value-from-json/14284/2).

```auto
pm.expect(jsonArrayData[0].fields.externalid).to.eql(parseInt(pm.collectionVariables.get("Customer_Number_Netsuite")));

```

Please try and let me know if this works 😊

---

_[View the full topic](https://community.postman.com/t/assertionerror-expected-to-deeply-equal/22977)._
