Forum Discussion

asifmpatel's avatar
asifmpatel
Occasional Contributor
9 years ago

Database CheckPoint

Hi all

Apologies in advance - im a beginner with TestComplete.

Ive tried looking up the answer - but i'm not having much joy.

 

I wish to perform a database check. After running through my test scenario – I need to ensure a value in the database has changed from 0 to ‘-1’. How can I check for this?

My understanding is – the ‘database checkpoint’ allows me to compare values in the database before and after to ensure nothing has changed – this is no good to me, as I need to ensure my value has changed.

 

Any help would be much appreciated.

Thanks in advance.

7 Replies

  • jpnjordan's avatar
    jpnjordan
    Occasional Contributor

    Hi,

     

    Have you tried creating two checkpoints? One to be run when the test starts (when the value is 0) and one to be run when the test completes (when the value is -1)?

     

    J

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      The database checkpoint compares your live database values to a stored value.  It's not exactly before and after but simply a check to see if the database has the expected values. So, if you create your checkpoint with a value of -1 and then execute the checkpoint at the appropriate time, you will know whether or not the item has changed.

       

      As suggested, you can do two such checks... the first to make sure that it is set to 0, the second to make sure it is set to -1. That should be sufficient to do the verification you are looking for.

      • asifmpatel's avatar
        asifmpatel
        Occasional Contributor

        Hi Robin.

        I dont think i explained the problem very well.

         

        The problem im having with creating a DBCheck is that im forward to specify the record whose flag i want to check again.

         

        In short - Midway through my keyword test a valid record is retrieved from the DB using the following query:

        select top 1 substring(t_reference, 3, 10) from tickets where t_complete = 0 and t_on_hold = 0 and t_cancelled = 0 and t_status=600 order by t_date_time_issued desc

         

        This record is then used to set a variable and to complete a number of operations using my software.

        At the start of my test there is a flag in the database which is set to "0" for my record.


        At the end of the keywordTest one of the database checks i need to perform is to verify the flag has been set to '-1'.

         

        Can anyone advise me on how i can create this checkpoint?

         

        Hope i'm making sense.

        Thanks in advance.