Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
6 years ago

Value retrieved from the database need to match the value from UI

I need to come up with the script 

 

Here is the case 

 

- Value retrieved from the database need to match the value from UI

 

I am using the DB table variables . I have stored the query in DB table variable. 

 

I can retrive the values from UI. 

 

Now I have to match the value from the database to that of UI. attached the screenshot.

 

My issue is how will I match the values.

 

Please advise 

 

Thanks

NG

 

 

4 Replies

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      these are the check points . I am already using the property checkpoints. 

       

      I looked at the database checkpoint but this will not slove the issue .

       

      My concerns is how will I match the value that shows in UI to the database value. As in the database we are showing the values rows. In UI we are showing the same values in the one Text with spaces in between

       

      For e.g

       

      in database 

      TB

      TR

      TT

      In UI

       

      TB TR TT

       

      Thanks

      NG

       

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        There are all sorts of string operations you can use to pick apart the text with spaces

        https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqstring/methods.html

         

        What I might do is read the whole text string from the UI into a variable, then use Trim to take the spaces out.  After that you can loop through the string 2 spaces at a time and get the next pair out to compare to the database.  Or you could not take the spaces out and loop through 3 at a time and do the compare with the first two and skip the space.  Or if you don't mind destructive testing, you can compare to the first pair and then delete them so you are always comparing to the first two.