Forum Discussion

contacteswart's avatar
contacteswart
Occasional Contributor
6 years ago

How to compare a value with real time query every time

I went through DB check point. It looks like it will run query once and store the results for comparision purpose.

My requirement is,

a. I will capture certain values during test run (Enrollment Date & Product Name). 

b. During check point SQL query has to be executed. To ensure that latest product details got updated in db. 

Captured values during test execution and values from SQL query execution (a & b) should be compared.

Is it possible in Test Complete ?

Storing query execution results in a table and comparing with the help of that table doesn't help much for my testing as I need to perform my check real time 

thanks

Eswara V

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Yes, it is possible.  However, as noted, a DB Table Checkpoint is not what you want in this case.

     

    Best suggestion is to write your own SQL code in TestComplete script code to execute the desired query and compare the results to your stored expected values.

     

    One of two ways to do so:

     

    1) Write ADO code to connect to your database and run the query.  You can find the starting details at https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sources/databases/ado-requirements.html for what's available in TestComplete but you will need to research additional information on the Microsoft online documentaiton.

     

    2) I have a script extension that I wrote that does simplify query execution somewhat.  You can find it in the link in my signature.  If you need help implementing that, let me know.

    • contacteswart's avatar
      contacteswart
      Occasional Contributor

      Thank you Very much. I really appreciate your quick response on this. 

      Regards

      Eswara