# Locator not being read correctly when trying to verify API response

**URL:** <https://forum.katalon.com/t/locator-not-being-read-correctly-when-trying-to-verify-api-response/38723>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [January 16, 2020, 1:49pm UTC](https://forum.katalon.com/t/locator-not-being-read-correctly-when-trying-to-verify-api-response/38723 "2020-01-16T13:49:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TDube](https://avatars.discourse-cdn.com/v4/letter/t/58f4c7/32.png) [@TDube](https://forum.katalon.com/u/TDube)\
**Post date:** [January 16, 2020, 1:49pm UTC](https://forum.katalon.com/t/locator-not-being-read-correctly-when-trying-to-verify-api-response/38723/1 "2020-01-16T13:49:23Z")

</div>

Good Morning,

I am currently trying to validate and API response and am running into an issue validating the property value.

The API response i am getting is as follows  
{  
“jobsList”:{  
“11867”:“CPPHL Daily Transactions- Equity”  
}  
}

When i press CTRL + K to get the validation the statement reads as follows

```
WS.verifyElementPropertyValue(response, 'jobsList.11867', "CPPHL Daily Transactions- Equity")

```

When I try to run this validation in my test case I am getting the following error.

```
 Unable to verify element property value (Root cause: 
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected token: 11867 @ line 1, column 102.
sonText);return root.jobsList.11867;

```

Any idea why this would be the recommended locator, but then throw an error? Could I possibly just be missing something simple?

The code in my test is below

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/2/2e09f0f987c5e4ae0da00ba4da01f7821dd60828.png)

---

<div class="post-metadata">

**Author:** ![huynguyen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/huynguyen/32/552_2.png) [@huynguyen](https://forum.katalon.com/u/huynguyen)\
**Post date:** [January 18, 2020, 4:21pm UTC](https://forum.katalon.com/t/locator-not-being-read-correctly-when-trying-to-verify-api-response/38723/2 "2020-01-18T16:21:42Z")

</div>

Hi @TDube,  
This issue is caused by using number as the JSON field name. One workaround is surrounding your number field name with double quotes. That means:  
WS.verifyElementPropertyValue(response, ‘jobsList.`"`11867`"`’, “CPPHL Daily Transactions- Equity”)

---

<div class="post-metadata">

**Author:** ![TDube](https://avatars.discourse-cdn.com/v4/letter/t/58f4c7/32.png) [@TDube](https://forum.katalon.com/u/TDube)\
**Post date:** [January 22, 2020, 11:49am UTC](https://forum.katalon.com/t/locator-not-being-read-correctly-when-trying-to-verify-api-response/38723/3 "2020-01-22T11:49:18Z")

</div>

That worked.

Thanks!
