Showing results for 
Search instead for 
Did you mean: 

Working with SQL Database using testcomplete

Occasional Contributor

Working with SQL Database using testcomplete

Hello guys,

I have a scenario where i have to query data from database and  i have to compare the db values with application values.

how can i do this using test complete?



Community Hero

Re: Working with SQL Database using testcomplete

TestComplete has access to ADO database drivers and can use them via the ADO object .  These are sufficient for creating simple queries that return values that you can then use in your tests anywhere.


If you are going to retrieve the data from multiple rows and validate them against application values in some sort of loop, you can also use the DDT.ADODriver method.


If you follow the link in my signature below, I have a Script Extension that wraps some of those ADO objects to make it easier to run sql queries.  


If you need more specific help with particular scenarios, we'd be more than happy to help but these three methods should be able to get you started.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Re: Working with SQL Database using testcomplete

Can't add much more to Robert's reply except to point to the (more general) article about working with Databases:


Working With Databases


and to point to some "How To" articles on working with SQL (but more on manipulating tables rather than just reading the DB):


start with the first of them: TestComplete How To: SQL

Community Hero

Re: Working with SQL Database using testcomplete



In addition to the previous replies: might be useful as well...

  /Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
New Here?
Join us and watch the welcome video:
Top Kudoed Authors