Forum Discussion

madhavan_s's avatar
madhavan_s
New Contributor
12 years ago

Property Checkpoint Condition


Hello Support Team,


 


I need to change the property checkpoint which has some initial values assigned to it. But now we had a requirement that we need to add a tolerance level between the actual and expected value specified under property checkpoint. So what are the possibilities we are having to change this in simple way, because we are almost having 100 tests.


 


For Example:


       Actual Value     :  4.8


       Expected Value :  5


 


       So for the above condition we need to apply a tolerance level of 0.2. So that the property checkpoint should pass.


 


Thanks,


Madhavan S


  • Hi Madhavan,


     


    You need to create a special comparison procedure in this case. Something like this:




    function Compare()


    {


      var storedValue = aqConvert.StrToFloat("5");


      var actualValue = aqConvert.StrToFloat("4.8");


      var dif= storedValue - actualValue;


      if (Math.abs(dif) <= 0.2)


        Log.Message("The values are the same");


    }




     


    The "Working With Numeric Values" article contains the information on how to work with numeric values in a script.