Database Checkpoints in WinRunner
Every application includes a database. The database is used to store the information. When an application is being tested, the database of that application should also be tested in order to assure that the values are entered into the database correctly. In Winrunner, for checking databases, we have a feature called “database checkpoints”.
About Checking Databases
Database checkpoints can be used in the test scripts to check databases in your application and the defects can be traced. You define a query on the database and then create a database checkpoint that checks the properties of the results of the query. When you check these properties, you can check the contents of the results or how many rows or columns the results contains.
Types of Database Checks:
Two types of database checks can be done in Winrunner:
- Default database check.
- Custom database check.
The above options are present in the menu bar Create-> Database checkpoint. In the default check, the query has to be manually defined. In this type of check, the properties you want to test cannot be specified. The winrunner captures the data defined by the query and stores it in the “exp” folder. A .sql query file is created and the database checklist is stored in the “chklist” folder. A database checkpoint is inserted in the test script as db_check statement.
In custom check, you can create a database checkpoint where you specify which properties to check on a result set. Different operations can be done on a database by the custom check like:
- Check the contents of the part or the entire result set.
- Edit the expected results of the contents of the result set
- Count the rows in the result set
- Count the columns in the result set.
When you create the custom check, a check database dialog box opens. The dialog box contains two panes – Objects pane and Properties pane. The Objects pane contains “Database check” and the name of the *.sql query file that will be included in the database checkpoint. The Properties pane lists the different types of checks that can be performed on the result set.
Database Checkpoint Wizard
The database checkpoint wizard opens whenever a database checkpoint is created.
The database checkpoint wizard enables you to
- To select the connection required to connect to the database.
- To specify the sql statement
- To specify the new query file name.
Two modes of database connections can be used. One is through the ODBC (Microsoft Query) mode and the other is Data junction mode. You can switch from one mode to the other as per your requirements.
We can specify a new query or an existing query can be copied into the query file. The number of rows to be verified can be limited in the main wizard itself.
If you are creating a default check, a db_check statement is inserted into the test script. If you are creating a custom check, the check dialog box appears.
Thus a database checkpoint can be created in the Winrunner and the defects regarding the database can be traced out.
If you have WinRunner Installation, just go through the Wizard, it’s very self explanatory.