# Problem with the verifyEval command

**URL:** <https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258>\
**Category:** Web Testing\
**Tags:** katalon-recorder\
**Created:** [May 30, 2018, 10:08pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258 "2018-05-30T22:08:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Sharp](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeff\_Sharp](https://forum.katalon.com/u/Jeff_Sharp)\
**Post date:** [May 30, 2018, 10:08pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258/1 "2018-05-30T22:08:25Z")

</div>

I’m attempting to compare the contents of two variables with the verifyEval command using the following syntax: verifyEval | storedVars[‘month’]==storedVars[‘month1’] | true. Upon execution of the test case, the verifyEval commands fail with ‘[error] did not match’. However, if I execute the single verifyEval command, it succeeds. Any reason this command isn’t working during execution of the test case?

---

<div class="post-metadata">

**Author:** ![Marnie\_Knue](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@Marnie\_Knue](https://forum.katalon.com/u/Marnie_Knue)\
**Post date:** [June 1, 2018, 8:03pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258/2 "2018-06-01T20:03:49Z")

</div>

I think the problem might actually have to do with **storedVars**. I was having the same issue (I even echoed **var1** and **var2** to make sure they were the same value), but when I changed the Target to be **${var1}==${var2}** , it worked.

---

<div class="post-metadata">

**Author:** ![Jeff\_Sharp](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeff\_Sharp](https://forum.katalon.com/u/Jeff_Sharp)\
**Post date:** [June 5, 2018, 3:38pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258/3 "2018-06-05T15:38:35Z")

</div>

Ok, I’ll try that. Thanks!

---

<div class="post-metadata">

**Author:** ![Jeff\_Sharp](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeff\_Sharp](https://forum.katalon.com/u/Jeff_Sharp)\
**Post date:** [June 5, 2018, 3:45pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258/4 "2018-06-05T15:45:41Z")

</div>

That worked! Thank you for the tip!

---

<div class="post-metadata">

**Author:** ![Jeff\_Sharp](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeff\_Sharp](https://forum.katalon.com/u/Jeff_Sharp)\
**Post date:** [June 6, 2018, 7:47pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258/5 "2018-06-06T19:47:39Z")

</div>

Well now this isn’t working any longer. The statement: verifyEval | ${state}==${state1} | true  
fails with the following error: [error] Threw an exception: Unexpected token {  
Any ideas what is causing this? Is the verifyEval command the best one to use for comparing the contents of two variables?

---

<div class="post-metadata">

**Author:** ![Jeff\_Sharp](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jeff\_Sharp](https://forum.katalon.com/u/Jeff_Sharp)\
**Post date:** [June 7, 2018, 5:51pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258/6 "2018-06-07T17:51:05Z")

</div>

Now I’m receiving this error:  
[info] Executing: | verifyEval | ${state}==${state1} | true |  
[info] Expand variable ‘${state}==${state1}’ into ‘MD==MD’  
[error] Threw an exception: MD is not defined

---

<div class="post-metadata">

**Author:** ![German\_Cons\_Tapia](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@German\_Cons\_Tapia](https://forum.katalon.com/u/German_Cons_Tapia)\
**Post date:** [July 9, 2018, 10:34pm UTC](https://forum.katalon.com/t/problem-with-the-verifyeval-command/11258/7 "2018-07-09T22:34:22Z")

</div>

I just checked[Jeff Sharp](https://forum.katalon.com/profile/3514/Jeff%20Sharp) said:

> Well now this isn’t working any longer. The statement: verifyEval | ${state}==${state1} | true  
> fails with the following error: [error] Threw an exception: Unexpected token {  
> Any ideas what is causing this? Is the verifyEval command the best one to use for comparing the contents of two variables?

I just tried this and it works

The trick is that there must not be any spaces in the Javascript otherwise it will throw this “unexpected token” error.

${var1}==${var2}

If you are checking strings use:  
“${var1}”==“${var2}”

The tricky part is that when you are editing be careful not to click on this line and then run, sometimes that will add the extra spaces automatically and then it will fail.
