In TestComplete tests, you can connect to databases, read data from them, and write data there. You can also create data-driven loops that will extract values from a database to DBTable variables and move to the following database record.
TestComplete uses database drivers that have the same bitness. If you use the Microsoft Open Database Connectivity Data Source Administrator tool to connect to a database, make sure the version you use has the same bitness as TestComplete. On a 64-bit operating system, you can find the 32-bit version of the tool (Odbcad32.exe) in the <Windows>\SysWOW64 folder.
Working with databases in tests
-
You can connect to a database and access its data by using the
ADO
object. To learn how to work with the object, see Using ADO Components and Working With Databases by Using ADO - Examples. -
You can use DBTable variables to read data from a database. See Working With Databases Using DB Table Variables.
-
To work with databases, you can also use methods of the
DDT
object. For more information, see Using DDT Drivers. -
To verify that a database contains the expected data, you can use database checkpoints. See Alternatives to Database Checkpoints.
Tutorials
Using the approaches described above, you can retrieve data from the needed database (or file), store records to variables and then use these variables in your tests. For more information that illustrates working with databases via TestComplete, we recommend that you get acquainted with the following tutorials:
Data-Driven Testing With Keyword Tests - Tutorial
Data-Driven Testing With Scripts - Tutorial