Comparing stored variables

So, how do you compare two stored variables to confirm they match? In the old Selenium IDE, I would use verifyEval | storedVars.var1==storedVars.var2 | true. But it looks like verifyEval no longer exists?

I’m pulling a set of values from a csv and then storing values in web forms to be able to verify that the values in the web page match the variables stored from the csv. In some cases, I can simply verifyValue = ${variable}, but in others, such as dates, which are actually split across three fields, I have store the values then concatenate into a variable to compare to the variable from the csv.

You can use the if command plus ThrowError instead:

if  | !(storedVars['var1']==storedVars['var2'])
 ThrowError | "Variables do not match"

These 3 lines are a direct and more flexible replacement for verifyEval.

Note that instead of

if | !(storedVars['var1']==storedVars['var2'])

This should also work:

if | !("${var1}" == ${var2}")

1 Like

I also would use something like that:
storeEval | ${var1} == ${var2} | GLOBAL_EQUAL