Generating Clean Scripts

Micro Focus Expert
Micro Focus Expert
0 0 2,196

When recording websites or web applications with Silk Performer you might end up with big, messy scripts, containing a lot of web requests you did not intend to record. Silk Performer 17 now provides a couple of traffic filters that allow you to exclude such unwanted requests. The graphic below summarizes the three traffic filters we will be discussing in this blog article: (1) the general filter, (2) the domain filter, and (3) the path and query filter. The filters display on the Capture File page. To learn more about capture files, read the blog article about Offline Scripting.Generating Clean Scripts - Blog graphic 1.png

How the traffic filters work

Before we use the traffic filters in a real-world example, let's first take a look at what they do and how they work. The general filter consists of two check boxes, or two settings: Exclude Proprietary TCP/IP Traffic and Exclude Browser-Specific Domains. When you enable Exclude Proprietary TCP/IP Traffic, Silk Performer will exclude all non-standard TCP/IP protocols. These can also be called proprietary protocols. All standard protocols like HTTP, FTP, LDAP, and so on, will be kept. When you enable Exclude Browser-Specific Domains, Silk Performer will exclude domains like or Browsers usually use such domains for statistical or tracking purposes. When you record a web application you typically do not want to include such traffic.

Next, there's the domain filter. You can use it to include or exclude requests to specific domains. If you want to learn more, read the blog article about Domain Filtering. It provides a comprehensive introduction to this topic. And then, there's the path and query filter. You can use it to exclude web requests that contain a specific string. Requests you cannot exclude with the domain filter (because you want to keep the respective domain in your script), can easily be addressed using the path and query filter.

Creating a new project

Now, let's try out the filters in a sample project. To do so, we first need to create a new Web business transaction project and record any website. We'll be recording for this example, because this website triggers quite a lot of events in the background. Make sure that you use Internet Explorer or Chrome for recording. These browsers typically make heavy use of the already mentioned proprietary protocols and browser-specific domains. For this example we need this otherwise unwanted traffic to learn what the filters can do for us.

Recording a website

Performing some clicks on should be enough to generate a big amount of events. Take a look at the number of events in the Recorder window. In our case, 516 events have been recorded. So let's close the browser, stop the recording, and save the script. The script displays in Silk Performer. As expected, it is a huge and messy script, full of web requests we actually do not want to have in there. Let's double-click the .spcap file in the tree to open the capture file. On the Capture File page, the three traffic filters display.Generating Clean Scripts - Screenshot 1.png

The general filter

We can see that the general filter settings are enabled by default (1), which makes perfect sense. You usually do not want to include any of the propriety TCP/IP requests or the requests caused by browser-specific domains. When you hover your mouse over the Exclude browser-specific domains check box, a tooltip appears (2). It shows which browser-specific domains have been detected. In our case it is the domain Let's disable the two general filter settings for a moment, just to find out how they affect the script. Click Generate and compare the new script with the initial script. The new one should be a little longer and it should contain a couple of web requests to

Generating Clean Scripts - Screenshot 2.png

The domain filter

Go back to the Capture File page and play around with the domain filter. In our example, we enable the filter (1) and include (2) just two domains: and (3). Now, when we generate a new script, it is considerably shorter and much more useful. All requests to the domains we didn't want to record in the first place are gone.

Generating Clean Scripts - Screenshot 3.png

The path and query filter

To try out filter number three, search for a string in your script you might want to exclude. In our example, we're going for the string px.gif (1). All requests that contain this string should be excluded from the script. So, again jump back to the Capture File page and enter px.gif in the field below the path and query filter (2). When you press enter, you can immediatly see the matches (3). Generate a new script and verify that the respective requests are removed.

Generating Clean Scripts - Screenshot 4.png


The traffic filters help you to tidy up your scripts and remove requests that were unintentionally recorded. Use the traffic filters in your Silk Performer projects and see what they can do for you.

Watch the Generating Clean Scripts video

The following video shows how to make use of the three traffic filters based on the same example we've discussed in this article:

More information

To learn more about all new features and enhancements Silk Performer 17.0 provides, take a look at the following blog posts:

The Silk Performer Help is another comprehensive source of information:

If this article was useful for you, leave us a comment or like it. We appreciate any of your feedback.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.