Previous Topic: Add a Filter from an HTTP ResponseNext Topic: Add a Filter from a Returned Java Object


Add a Filter from a JDBC Result Set

When you have access to the result set response from a JDBC step, you can use the response to add a filter directly.

This example demonstrates how to add a filter from the JDBC Result Set response using the response from the Verify User Added step in the multi-tier-combo test case.

Follow these steps:

  1. To open the step editor, double-click the Verify User Added step.

    Screenshot of multi-tier-combo Verify User Added step

  2. To get values in the result set, edit the SQL statement to read select * from users and click Test/Execute SQL.

    Add a Filter from a JDBC Result Set SQL statement

  3. To get values in the result set, click the Result Set tab and click Test/Execute SQL.

    Add Filter from a JDBC Result Set - Verify User Added

  4. Click the cell in the result set tab that represents the location of the information to capture (sbellum).
  5. Click Generate Filter for Current Col/Row Value LISA--icon_image_threebluearrows.
  6. In the dialog that opens, enter the property key theLogin.

    Add Filter from a JDBC Result Set - Verify User Added - Enter property key for value

  7. Click OK.

    DevTest adds a filter with the name Parse Result Set for Value in the list user step.

  8. To see the filter, click the filter editor.

    Parse Result Set for Value window

    In the example, the value in the cell in the first column, and eighth row, sbellum, is stored in the property theLogin.

Applying a Second Filter

A second filter can be applied here. You can look for a value in one column of the result set, and then capture a value from another column in the same row.

Follow these steps:

  1. From the result set, select the two values in two different columns from the same row, using the Ctrl key.

    Add a Filter from a JDBC Result Set - Result set with two cells selected

  2. Select Filter for a value and then get another column value filter using the Icon patchwork icon. To create this filter, select two cells in the same row. One is the search column and the other is the column whose value you want to extract.
  3. In the dialog that opens, select or reassign the columns for the search and the value.
  4. Enter the property key theEmail.

    Generate Value for Value Filter dialog

  5. Click OK.

    DevTest adds a filter with the name Get Value For Another Value in a ResultSet Row in the Verify User Added step.

    Get Value For Another Value in a ResultSet Row filter

    The Get Value For Another Value in a ResultSet Row filter looks for sbellum in the LOGIN column. If the filter finds sbellum, it stores the value in the EMAIL column in the same row in a property with the name theEmail.

Note: The same filtering capabilities are available when a JDBC result set is displayed in the Step Editor.