Creating a Custom Check on a Database - WinRunner

When you create a custom check on a database, you create a standard database checkpoint in which you can specify which properties to check on a result set.

You can create a custom check on a database in order to:

  • check the contents of 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

You can create a custom check on a database using ODBC, Microsoft Query or Data Junction.

To create a custom check on a database:

  1. Choose Insert > Database Checkpoint > Custom Check. If you are recording in Analog mode, press the CHECK DATABASE (CUSTOM) softkey in order to avoid extraneous mouse movements. Note that you can press the CHECK DATABASE (CUSTOM) softkey in Context Sensitive mode as well.
  2. Follow the instructions on working with the Database Checkpoint wizard, as described in “Working with the Database Checkpoint Wizard”
  3. If you are creating a new query, an instruction screen opens for creating a query.
  4. If you do not want to see this message next time you create a default database checkpoint, clear the Show this message next time check box.

  5. If you are using ODBC or Microsoft Query, define a query, copy a query, or specify an SQL statement.
  6. If you are using Data Junction, create a new conversion file or use an existing one.

  7. If you are using Microsoft Query and you want to be able to parameterize the SQL statement in the db_check statement which will be generated, then in the last wizard screen in Microsoft Query, click View data or edit query in Microsoft Query. Follow the instructions in “Parameterizing Standard Database Checkpoints”
  8. WinRunner takes several seconds to capture the database query and restore the WinRunner window.
  9. The Check Database dialog box opens

    The Check Database dialog box opens

    The Objects pane contains “Database check” and the name of the *.sql query file or *.djs conversion file included in the database checkpoint. The Properties pane lists the different types of checks that can be performed on the result set. A check mark indicates that the item is selected and is included in the checkpoint.

  10. Select the types of checks to perform on the database. You can perform the following checks:
  11. ColumnsCount: Counts the number of columns in the result set.

    Content: Checks the content of the result set, as described in “Creating a Default Check on a Database,”

    RowsCount: Counts the number of rows in the result set.
    If you want to edit the expected value of a property, first select it. Next, either click the Edit Expected Value button, or double-click the value in the Expected Value column.

    • For ColumnsCount or RowCount checks on a result set, the expected value is displayed in the Expected Value field corresponding to the property check. When you edit the expected value for these property checks, a spin box opens. Modify the number that appears in the spin box.
    • For a Content check on a result set, <complex value> appears in the Expected Value field corresponding to the check, since the content of the result set is too complex to be displayed in this column. When you edit the expected value, the Edit Check dialog box opens. In the Select Checks tab, you can select which checks to perform on the result set, based on the data captured in the query. In the Edit Expected Data tab, you can modify the expected results of the data in the result set.
  12. Click OK to close the Check Database dialog box.

WinRunner captures the current property values and stores them in the test’s exp folder. WinRunner stores the database query in the test’s chklist folder. A database checkpoint is inserted in the test script as a db_check statement.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics