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"
EndIf
These 3 lines are a direct and more flexible replacement for verifyEval.
Note that instead of
if | !(storedVars['var1']==storedVars['var2']) Important: The solution here is for the deprecated first version of If (not if_v2). V2 no longer needs and supports storedVars.
This should also work:
if | !("${var1}" == ${var2}") Important: If_V2 no longer uses “” around the variables. So now the answer is: if | !(${var1} == ${var2})
I have two variables which depending on the outcome of previous steps in the macro, each variable COULD be either “Found,” or “Not Found.” The variables are called “SAMCheck” and “OIGCheck”
I have attached the section of code where I am trying to achieve this
This also seems to be a round about way of doing it – what I really want to do is see if BOTH – OIGCHECK & SAMCHECK = NOT FOUND and based on the result being either true or false save a new value to a new variable called “Assess,” which is either “Assess” or “ Clear No Results Returned”
Thank you!
Also sent to support email as an enterprise bundle user - not sure if support@a9t9 is correct or not for enterprise tickets
Thank you! I ended up figuring out that the above worked in IF_V1 - I will try the modified answer for If_V2 tomorrow - thank you very much for your quick response!