Simulating random network failures using Fiddler

When testing a system that connects to an API, it’s important to ensure that it continues to function in the result of random network failures, dropouts or error responses. The AutoResponder feature in Fiddler provides the ability to simulate such behaviour.

First, install Fiddler. An email is required to download but you can put anything in the field. Once installed, requests should start flooding in for your inspection.

One the right side, go to AutoResponder. Add a rule that matches the URL pattern of the page or pages that should fail. There are some some examples in the dropdown e.g. regex:http://httbin.org/* will match all pages from http://httpbin.org. Select an appropriate response from the list or create a new one.

To simulate responses at random simply prepend the rule with a percent e.g. 10%regex:http://httbin.org/*. Multiple rules can be added to simulate multiple response types.

Fiddler AutoResponder

Once the rules have been added, tick “Enable rules” and “Unmatched requests passthrough”. Requests will begin to fail as defined in the rules.