Previous Topic: Add a Filter ManuallyNext Topic: Add a Filter from a JDBC Result Set


Add a Filter from an HTTP Response

When you have access to the response from an HTTP-based step, you can use the response to add a filter directly.

This example uses the response of the login step in the multi-tier-combo test case in the examples directory. The point of this example is to capture the text where MyMoney Home currently appears on the window. (It is not always the same text).

Follow these steps:

  1. Run the multi-tier-combo test case in the ITR, and then select the Login test step.

    Screenshot of multi-tier-combo in ITR with Login step selected

  2. Select the text MyMoney Home in the View tab
  3. To see that this text is selected in the tree view, click the DOM Tree tab.

    Screenshot of multi-tier-combo in ITR, DOM Tree view of Login step

  4. To apply an inline filter, double-click the login step in the model editor to open the HTTP/HTML Step Editor.

    HTTP/HTML Step Editor for login step

  5. Move to the DOM Tree tab, find MyMoney Home in the DOM Tree view, and select it.
  6. At the bottom of the window, in the Select a Command box, select Parse Value Filter from the drop-down list.
  7. In the dialog that is displayed, enter the name for the Property Key "wasAdded":

    HTML/XML Filter Info dialog

  8. Click OK.

    Parse Text from XML Filter

You can also add an assertion here. For example, you would probably want to test the value of the property wasAdded, to see if it is in fact equal to Added user. More information is available in Adding Assertions.

The generated filter appears as a filter in the login test step.

The same filtering capabilities are available when an HTML response is displayed in the step editor.