Forum Discussion

sameerjade's avatar
sameerjade
Frequent Contributor
7 years ago

Check object property checkpoint for comparing numbers using wText

Hello,

 

I am trying to compare the numerical values (double type) in several text boxes of a desktop app window. I am using the check object property checkpoint and using the 'wText' property (example below). This is working fine. My questions are:

 

aqObject.CheckProperty(Aliases.MyWindow.MyTextbox, "wText", cmpEqual, "1234.78");

 

1. Is there anything getting stored here in my Stores location (Objects, Files etc). I have verified that it is not but just want to confirm from a maintenance stand-point.

 

2. Is this the most efficient, elegant way to compare numbers? Especially when I am doing it for several 'wText' values in the same window. Currently I am calling the 'aqObject.CheckProperty....' several times for all the values that I want to verify.

 

Thank you!

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    sameerjade wrote:

    Hello,

     

    I am trying to compare the numerical values (double type) in several text boxes of a desktop app window. I am using the check object property checkpoint and using the 'wText' property (example below). This is working fine. My questions are:

     

    aqObject.CheckProperty(Aliases.MyWindow.MyTextbox, "wText", cmpEqual, "1234.78");

     

    1. Is there anything getting stored here in my Stores location (Objects, Files etc). I have verified that it is not but just want to confirm from a maintenance stand-point.

     


    For that particular command, nothing gets stored in the Objects or Files location.  This is simply comparing the value stored in the wText property of the object with the string value of "1234.78".

     


     

    2. Is this the most efficient, elegant way to compare numbers? Especially when I am doing it for several 'wText' values in the same window. Currently I am calling the 'aqObject.CheckProperty....' several times for all the values that I want to verify.

     


    What you could do is do an Object checkpoint.  This has been deprecated in TestComplete 12.30 but it is still available.  This allows you to store an object and its child objects and a set of properties in a single file (which does get stored in the Stores|Objects section) which you can then do a check against.  As for "efficient" or "elegant"... I think it's about 6 one way, half a dozen the other... You may have more lines of code for the property checkpoint but I find the maintenance and comparison of updates balances that out... meanwhile, an object checkpoint has the elegance of a single line of code for the comparison but maintaining the object checkpoint when the AUT changes is a little trickier than just editing lines of code.  Personally, since you already have it working with property checkpoints AND since Object checkpoints have been deprecated, I'd stick simply with what you have.

    • sameerjade's avatar
      sameerjade
      Frequent Contributor

      Thank you, Robert. I am sticking with my current setup for now.

       

      -Sameer