Modifying Traffic

Fiddler Everywhere provides powerful debugging techniques for testing APIs and mocking server and client behavior. Modifying traffic through the Rules functionality is crucial to the Fiddler testing and debugging capabilities.

A rule in Fiddler Everywhere is a feature that allows you to match a targeted HTTP(S) session and apply a specific action that will modify its original behavior. A rule can be created, activated, and executed through the Rules tab in the Traffic pane.

Using Fiddler's rules allows you to modify the ongoing HTTPS requests and responses without accessing or modifying the client and server applications.

To open the Rules tab.

  1. Start Fiddler Everywhere and open the Home Pane.

  2. Follow the Rules flow from the Modify and Filter Traffic section.

    Using the Fiddler's rules from the **Home** pane

OR

  1. Start Fiddler Everywhere and open the Traffic Pane.

  2. Select the Rules tab.

The Rules tab loads, and you can create, enable, organize, and rank rules in the Rules list.

Example of active Rules tab with rules and groups

Using Rule Builder

Use the Rule Builder to create custom rules from scratch. Each rule can automatically trigger a specific action that meets the preset matching criteria. To mock a client request or server response, enable the Rules tab, set a rule, and execute the request that will trigger that rule.

To create and test a rule through the Rule Builder:

  1. Select the Rules tab and click the Add Rule button. As a result, the Rule Builder opens.

    Adding new rule for modifying an HTTPS session through the Rule Builder

  2. Enter a descriptive rule name, which will appear in the Rules list.

  3. Add a condition or a set of conditions to match sessions.

  4. Add an action or a set of actions to modify the matched sessions.

  5. Click Save to save and add the created rule in the Rules list.

  6. Start capturing traffic or replay a specific session that triggers the rule.

    - If you test with system capturing, independent browser, terminal, or through explicit proxy—Ensure that the switch of the main Rules tab is toggled ON. Open the application in the browser and execute a request that matches the set conditions. The rule immediately applies to the ongoing captured traffic.

    - If you test with already saved sessions—Select the rule and use the Execute button (green play arrow). The rule immediately applies to the preloaded saved sessions.

The Rules tab can be a powerful ally in testing various complex scenarios without meddling with the server. You can share, import and export created rules with collaborators to ease your support, development, and QA processes.

Creating Rules for Captured Sessions

One of the most powerful features in Fiddler Everywhere resides in the Rules tab. You can create rules that change HTTP Requests & Responses on the fly based on different criteria. The rules can combine multiple criteria and apply single or multiple actions, allowing you to mock real-life scenarios with a few clicks. The combinations of matching conditions and actions that can be combined and applied to single or multiple rules enable you to test client and server applications without changing or accessing their code.

To modify the captured session through the Rules:

  1. Start any capturing mode with Fiddler Everywhere and initiate the request. As a result, the session is captured and displayed in the Live Traffic grid.

  2. Select the desired session and right-click to open the context menu. From the context menu, select Add New Rule.

    Add new rule through selecting a session and using the context menu

   

The Rule Builder opens in a dedicated detached window. This enables you to create your rule and observe the Live Traffic simultaneously.

  1. The Rule Builderautomatically populated the session data. You can further modify the matching conditions and the desired actions.

    Automatically loaded session in Rules builder

  2. Click Save to preserve the rule.

Fiddler automatically adds the newly created rule on the top of the Rules list, giving it immediate execution priority (you can demote or promote each rule in the list). The rule is also automatically activated (the rule switch toggles on), so any new requests that match the rule will be affected by it. You can also replay the original session through its context menu (Replay > Reissue Requests).

Additional Rules Resources