teddy_john1's avatar
teddy_john1
Frequent Visitor
5 years ago
Status:
New Idea

Execute database query using onscreen value

We need to grab an onscreen value (confirmation number, ticket number etc) from web page and pass that value into a sql query to perform a database checks. So, i am using a project variables to capture the on-screen value.

Currently, i have to edit the db checkpoint and insert the value manually into the custom query page to perform back end validation using TestComplete.


For values that change every time the test case is executed (example - confirmation number) If we can automate the process of capturing the on-screen value from the variable and passing it to the query, the whole test case will become automated and reduce the need for manual intervention.

Are there any other approaches adopted by any other customers which might help solve this need?

6 Comments

  • Yes - Please add this Feature/Function.  It would save us so much time.

  • Shirin's avatar
    Shirin
    New Contributor

    This feature would be great. Order #'s are dynamic or sometimes other entries are based on date/time. It would be great to grab this entry and enter in a query.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Yup.  Write script code.  This is easily done by using the various ADO objects available to your automation script code to write you're own SQL queries against your database, passing in any parameters, checks, etc, that you want.   What makes a "Checkpoint" a checkpoint is simply that it encapsulates the query code and such into it's own operation and then uses, internally, the "Log.Checkpoint" method to write a "pass" log entry to the log or a "Log.Warning"/"Log.Error" for a fail.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    FYI, I have a Script extension that I created that allows you to connect to SQL databases and run custom queries.  All you would need to do is use that to create the SQL processing and then wrap that into additional code for the logging and object property capturing.