Forum Discussion

DavidRedmayne's avatar
DavidRedmayne
Occasional Contributor
9 years ago

Compare properties of two objects

I need to be able to assert that a value entered and saved on one web-page is appearing on a different web-page - so if I enter £250.00 in TextBox 'Value' on Page 1, I need to be able to validate that £250.00 is displayed in TextBox 'cash added' on Page 2.

 

I'm sure this is probably quite straightforward but cannot seem to find a Checkpoint that caters for this...any guidance please?

 

Thanks

 

David

  • DavidRedmayne's avatar
    DavidRedmayne
    9 years ago

    Thanks tristaanogre. Yes you're quite right....the objects under comparison are on different pages - however, I think your idea, in conjunction with baxatob's input should work OK.

     

    Thanks

     

    David

  • baxatob's avatar
    baxatob
    Community Hero

    The simplest approach is to use the Property Checkpoint for your textbox.

    Check its property .value or .Text

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      There is not a specific checkpoint to compare the object properties on one page to the properties on another page.  What makes it trickier, if I understand it correctly, is that the two objects don't co-exist on the same page so you can't even do a comparison within the page.

       

      However, you do have control over the value being typed in, am I correct?  So, you could use the aqObject.CheckProperty (as baxatob mentions) method to check to see if the value on your object equals what you typed in previously.  Something like:

       

      MyTestValue = '250.00';
      aqObject.CheckProperty(Aliases.MyForm.CashBox, "value", cmpEqual, MyTestValue, false);

      Or, if you're using keywords, in your Property Checkpoint operation, click in the Value field and click the Ellipses... you can then change the value property to point to a variable rather than a constant.

       

       

      • DavidRedmayne's avatar
        DavidRedmayne
        Occasional Contributor

        Thanks tristaanogre. Yes you're quite right....the objects under comparison are on different pages - however, I think your idea, in conjunction with baxatob's input should work OK.

         

        Thanks

         

        David