# verifyElementPropertyValue

**URL:** <https://forum.katalon.com/t/verifyelementpropertyvalue/38325>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [January 7, 2020, 6:18pm UTC](https://forum.katalon.com/t/verifyelementpropertyvalue/38325 "2020-01-07T18:18:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amohan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/amohan/32/20483_2.png) [@amohan](https://forum.katalon.com/u/amohan)\
**Post date:** [January 7, 2020, 6:18pm UTC](https://forum.katalon.com/t/verifyelementpropertyvalue/38325/1 "2020-01-07T18:18:20Z")

</div>

I’m facing a weird and interesting issue with the keyword -verifyElementPropertyValue.  
I try to verify a property value from the REST response and for some reason only the FIRST character of the  
actual value of the field is read and therefore the validation fails.

For E.g.,  
Srtring accountId = B000000  
my response also has ‘accountNumber = B000000’

Now consider → verifyElementPropertyValue(getResponse, “accountNumber[0]”, accountId)

this fails with an error saying ❌ Expected element property value ‘B000000’ is not equal with actual property value ‘B’.

Note : I’m using the version 6.2.1 and my previous scripts with the same keyword are working fine.  
Kindly help.

---

<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 8, 2020, 4:10pm UTC](https://forum.katalon.com/t/verifyelementpropertyvalue/38325/2 "2020-01-08T16:10:22Z")

</div>

Hi @amohan,  
Can you share your whole response?  
Regards.

---

<div class="post-metadata">

**Author:** ![amohan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/amohan/32/20483_2.png) [@amohan](https://forum.katalon.com/u/amohan)\
**Post date:** [January 8, 2020, 5:43pm UTC](https://forum.katalon.com/t/verifyelementpropertyvalue/38325/3 "2020-01-08T17:43:55Z")

</div>

Hi @huynguyen, I wont be able to post the entire response here but below is the part you might be looking for,

“text” : "{“accountClass”:“Estates”,“accountNumber”:“B000000”,“accountStatus”:“Active”,“accountSubType”:“NotSet”,…}

---

<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 22, 2020, 4:37pm UTC](https://forum.katalon.com/t/verifyelementpropertyvalue/38325/4 "2020-01-22T16:37:02Z")

</div>

Hi @amohan,  
Please remove the index [0] from your locator

---

<div class="post-metadata">

**Author:** ![amohan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/amohan/32/20483_2.png) [@amohan](https://forum.katalon.com/u/amohan)\
**Post date:** [January 22, 2020, 9:29pm UTC](https://forum.katalon.com/t/verifyelementpropertyvalue/38325/5 "2020-01-22T21:29:16Z")

</div>

That worked. Thanks!

---

<div class="post-metadata">

**Author:** ![bernadette.medrano](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/bernadette.medrano/32/23870_2.png) [@bernadette.medrano](https://forum.katalon.com/u/bernadette.medrano)\
**Post date:** [June 18, 2020, 3:25am UTC](https://forum.katalon.com/t/verifyelementpropertyvalue/38325/6 "2020-06-18T03:25:51Z")

</div>

Hi,  
I’m having issues with keyword verifyElementPropertyValue too. Sometimes my test case fails and sometimes it does. The error I’m getting is:

Unable to verify element property value (Root cause: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:  
Script1.groovy: 1: unexpected token: [ @ line 1, column 93.  
rseText(jsonText);return root.[null].emp  
^

1 error

```
at com.kms.katalon.core.webservice.helper.WebServiceCommonHelper.parseAndGetPropertyValueForJson(WebServiceCommonHelper.java:162)
at com.kms.katalon.core.webservice.keyword.builtin.VerifyElementPropertyValueKeyword$_verifyElementPropertyValue_closure1.doCall(VerifyElementPropertyValueKeyword.groovy:52)
at com.kms.katalon.core.webservice.keyword.builtin.VerifyElementPropertyValueKeyword$_verifyElementPropertyValue_closure1.call(VerifyElementPropertyValueKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:68)
at com.kms.katalon.core.webservice.keyword.builtin.VerifyElementPropertyValueKeyword.verifyElementPropertyValue(VerifyElementPropertyValueKeyword.groovy:48)
at com.kms.katalon.core.webservice.keyword.builtin.VerifyElementPropertyValueKeyword.execute(VerifyElementPropertyValueKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords.verifyElementPropertyValue(WSBuiltInKeywords.groovy:189)
at Verify DV highlight a genuine failure for error-codes.run(Verify DV highlight a genuine failure for error-codes:60)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:169)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:142)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:91)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1592362928250.run(TempTestSuite1592362928250.groovy:37)

```

)  
Sample JSON Response is:  
[  
{  
“empno”:“emp01”,  
“errorCode”:“ERR-001”  
},  
{  
“empno”:“emp02”,  
“errorCode”:“ERR-002”  
}  
]  
my code is something like this:  
verifyElementPropertyValue(response, ‘[1].errorCode’, errorCode)

The value for the variable errorCode in my test data have hyphen e.g. ERR-001.

Thanks for your help
