During the web recording, it is likely that web requests were made to hosts that are not intended to be part of the test. The Filter hosts page of the wizard enables you to filter out hosts that shouldn't be contacted during a test.
The list of hosts to which requests were made during the recording - are listed on the left. Each is displayed with an icon to indicate whether recorded web requests made to that host will be included in the generated script or not.
On the right are the filters that will be applied to the list of hosts.
These filters will also be applied during a test. For example:
- A request is made to a host to download a web page during a test.
- That web page specifies resources (such as images) that must also be downloaded for the web page to be displayed correctly.
- The resources might need to be downloaded from a location other than where they were located during the recording, e.g. if they are hosted on a Content Delivery Network or on load-balanced servers, or if the site has changed since the recording was made.
- The hostname of the new location will be evaluated according to the filters specified here, as to whether a sub-request will be made to download the resources.
The filters can operate in one of two ways:
Blocklist: any host that matches the filter will not have any requests made to it during a test. Requests will be made to any other host. Use this to exclude specific unwanted servers, such as advertising services.
Allowlist: (default) only hosts which match the filter will have any requests made to them during a test. Requests will not be made to any other host. Use this if you know exactly which hosts you are trying to test.
To add a filter, select a filter type from the Filter type box, enter the filter text into the Filter text box and then click Add. As you type in the Filter text box, the list of hosts will update automatically to show the effect of the filter you are about to add. You can add exact match filters for particular hosts in one of two ways:
Select one or more hosts in the list of hosts, then click Include selected or Exclude selected.
Select one or more hosts in the list of hosts, then right-click one of them and click Include selected or Exclude selected
Filters will be added or removed from the list in order to include or exclude the selected hosts. A warning message will appear if the filters are too complicated to be modified automatically.
Filtering Hosts After Script Generation
In the Project tree, select the Recording item.
On the Recording view, click Apply host filter. The Filter Hosts window appears, which is similar to the Filter hosts wizard page described above:
After clicking Apply Filter, you may wish to regenerate any scripts that have previously been generated from this recording. Filtering hosts only changes the recording, not the scripts.
Regenerating a script will remove any manual edits that are not within the defined Regions in the script—that is, any changes you made in an IDE or text editor since the script was generated. We recommend only editing the within those regions.