Forum Discussion

Udayreddy_90's avatar
Udayreddy_90
Contributor
13 years ago

DB Table

My scenario is like this...

   1. 'XYZ' table is having 10 records.

   2. I inserted one more record to that table through the TC script.

   3. I want to test, the inserted record data is properly inserted into 'XYZ' table.



------------ I did like this -----------------------

   1. Call DBTables.Table1.Check     ( Created DB Table check point      )

   2. Inserted record into the 'XYZ' table.

   3.  Call DBTables.Table1.Check



( Actually inserted record is properly inset in to 'XYZ' table )

in step1 : Check point is pass.

in step2 : Check point is fail. ( because DBTable check point is not updated with inserted record )





 
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Uday,


    As far as I understand, you want your checkpoint to pass successfully in both cases, right?


    If so, I recommend that you create one more DBTable checkpoint that will store the 'XYZ' table with the added row, and then use this checkpoint in the Call DBTables.Table1.Check line.


    I hope this information helps :)

  • Then there is no meaning of DB check point, because we can't create new check point every time when we insert a new row into that table.



    I want update the check point and compare this updated check point with the DB table. How can do this?

     
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Uday,


    The fact is that checkpoints are made to check the application at the specified moment of a test run. TestComplete provides you with an updating feature, but if you update the checkpoint after a new row is added, the first checkpoint will fail during the next test run.


    So, if you need to check the contents of the table both before and after the row is added, you can either create two checkpoints (as I've described), or you can get access to the contents of the database and create a query that will check whether the target row is present in the database. To learn how to work with databases from your tests, refer to the "Working With Databases" help topic.