Previous Topic: HTTP/HTML FiltersNext Topic: Parse Web Page for Properties


Create Resultset from HTML Table Rows

To create a result set (for example, a JDBC result set) from an HTML table that the response returns, use the Create Resultset from HTML Table Rows filter. You can select the columns and rows of an HTML table, then create a result set from them. You can then use the result set to generate assertions exactly as in a database step.

You can create this filter by selecting it from the filter list and defining the parameters. However, it is easier to create the filter directly from the HTTP/HTML Request step response using one of the filter commands for that step. This approach is used here. The parameters that are produced in the following procedure (the parameters you would calculate to create this filter manually) are shown later in this section.

To create a filter on a table:

  1. Record a web page that contains the table.
  2. Go to the appropriate HTML step, and view it from the DOM tree.
  3. Select the values to place in the table, using the Ctrl key to select multiple fields. Select one example value from each column in the table that you want to use in the result set.

    Create HTML Table Results Filter from an HTML step

  4. When it is highlighted, select Create HTML Table Results Filter.
  5. Enter the property name in the window.

    Enter property key name dialog

    The property is now available in the test case.

The property is added to the current step. The following graphic shows the parameters that were calculated for this step. These parameters are required when you create this filter manually.

Create Resultset from HTML Table Rows filter parameters

To show the filter results, we added a step of type Save Property as Last Response and added the property that the filter creates. The result set panel displays the results.

Reselt set panel showing results of Create Resultset from HTML Table Rows filter

If you are editing a test case, you may need to replay the test case to generate the property from the filter using the Replay test case to a specific point command. To do so, use the Replay test case to a specific point command. The Replay test case to a specific point command is activated by clicking Replay Icon arrow and circle on the toolbar. You can now use the embedded filters and assertions that are available at the bottom of the result set window of this step.