Sum of two variable values
I am trying to sum up the total of two different variables and store the value in a third variable. However, for some odd reasons, the variable (result) is reflecting the individual value of each variable and not the sum total. I am not sure what wrong have I done. Can some please advise ?
I would have expected a sum total of above two values to reflect in the result variable.
Thanks in advance.
Str := '$40,900.99';
// Uses the SubString method
Log.Message( aqString.Replace(Str, '$', '') ); // Posts "1234"
Log.Message( aqString.Replace(Str, ',', '') ); // Posts "45678"
Log.Message(Str); // Posts "789"
This should do what you are looking for! Let me know if you have any questions. You can run this in a keyword test using a "Run Script Routine" operation. Also you will want to use a persistent project level variable to store the variable so you can manipulate it in the function and then use it in your checkpoint.