Rules Tab

The Rules tab enables you to create rules that will automatically trigger in response to requests.

The Rules functionality provides options for testing changes to web code without updating the production server, reproducing previously captured bugs in SAZ files, and running website demos while you are offline.

The collaboration functionalities allow you to import and export a single rule or sets of rules, and share rules directly with other Fiddler Everywhere collaborators. Each rule has a different order priority and execution weight which can be easily controlled by promoting or demoting a rule.

The Rules tab is available as of version 2.0.0 and later, while previous versions have the Auto Responder tab. The capabilities of the functionalities are different—the Rule Builder can change what the servers will receive in terms of requests and responses and given that such rules are applied. The Auto Responder is only capable of mocking a server request or response and of modifying the local request or response. Therefore, not all rules change the server data.

Rules tab

The Rules tab contains the following sections:

  • Rules Toolbar—Provides options for sharing, manual import or export, and manual execution.
  • Rule Builder—Creates new rules and edits existing ones.
  • Rules Queue—A queue of created rules that are executed in the order of appearance from top to bottom. Each rule in the queue has its own toolbar with different rule-related functionalities.

Built-In Logic

When executing each rule or running a rule on previously saved sessions, Rules follows a built-in logic depending on whether the session is actively captured (ongoing Live Traffic sessions).

Live Traffic and Rules stick to the following basic guidelines:

  • The Rules main toggle is available only for the Live Traffic section.
  • The Unmatched Requests Passthrough is applicable only for ongoing capture through the Live Traffic section.
  • If the Rules toggle is ON, and a selected rule toggle is ON, the rule executes for all of the inbound/outbound captured traffic (the Live Traffic section with enabled Capturing).
  • If the Rules toggle is ON, and a selected rule toggle is OFF, the rule won't execute for all of the inbound/outbound captured traffic (the Live Traffic section with enabled Capturing).

Saved Sessions and Rules stick to the following basic guidelines:

  • The Rules main toggle is not available for saved sessions (from the Sessions list). The toggle will be hidden when a saved session is loaded.
  • Execute from the primary Rules toolbar will execute all currently selected rules. The result applies for all sessions that are matching the conditions of the rule. If multiple rules are selected, they will be executed in the order of appearance in the Rules Queue—this means that a rule can be overwritten by another rule that comes later in the queue. Some rules are also final, which means that no other rules in the queue will be executed after a final rule
  • The Execute button from a selected rule toolbar will only execute the currently selected rule.

Rules Toolbar

The main toolbar of the Rules comes with the following functionalities:

  • Add New Rule—Opens the Rule Builder window to create a new rule.
  • Shared Ruleset—Opens a list of the shared rulesets.
  • Share—Opens the Share windows where you can enter a collaborator email to share all created rules.
  • Import—Prompts a window for importing a FARX file.
  • Export—Exports all created rules in a FARX file.
  • Execute—Executes the selected rules for the captured traffic or for the loaded, saved sessions.

Rules tab toolbar

Rule Builder

The Rule Builder interface enables you to create and edit rules. For each new rule, you need to enter a condition (previously known as a match rule) and an action (previously known as an action string). Fiddler Everywhere will undertake the action if the request URI matches the condition and if the rule is executed.

Rule Builder Conditions

Adding New Rules

To add a new rule:

  1. Click the Add New Rule button from the main toolbar.
  2. Add a new name for your rule in the Rule Name text field.
  3. Set the When rule based on one of the following statements:
    • all these conditions—The rule will be applied when all conditions are true (logical TRUE).
    • any of these conditions—The rule will be applied when any conditions are true (logical OR).
    • none of these conditions—The rule will be applied when none of the conditions is true (logical FALSE).
  4. Add one or more conditions. See the conditions section for more details.
  5. Add one or more actions. See the actions section for more details.
  6. Click Save to close the Rule Editor and add the newly created rule to the Rules Queue.

When creating a new rules, take into consideration the following tips:

  • Rules are applied in their order of appearance in the Rules Queue. To demote a rule in the queue, use the Down Arrow; to promote a rule on the queue, use the Up Arrow.
  • You can export the current queue of rules through the Export button from the Rules Queue toolbar.
  • To queue rules based on previously captured traffic, import a .FARX file through the Import button.

Conditions

The Rule Builder can add and use single or multiple conditions. The conditions are logical structures with different statements whose number can be between two and four. For more information, refer to the following list.

Condition Value Field Options Field Options Field Options Usage Description
Protocol HTTP or HTTPS n/a n/a Differentiate the traffic based on the used protocol (HTTP vs HTTPS).
Host String modifiers Search value n/a Search for a specific keyword in the Host column.
Status String modifiers Search value n/a Search for a specific keyword in the Result column.
Method String modifiers Search value n/a Search for a specific keyword in the Method column.
Process ID String modifiers Search value n/a Search for a specific keyword in the Process ID column.
Client IP String modifiers Search value n/a Search for a specific keyword in the Client IP column.
Remote IP String modifiers Search value n/a Search for a specific keyword in the Remote IP column.
Body Size Number modifiers (compares bytes) Search value n/a Search for a specific value in the Body Size column.
Duration Number modifiers (compares milliseconds) Search value n/a Search for a specific value in the Duration column.
Comment String modifiers Search value n/a Search for a specific keyword in the Comment column.
Request Body String modifiers Search value n/a Search for a specific keyword in the Request Body column.
Request Header Header name String modifiers The search value Search for a specific keyword in the explicitly mentioned Request header column.
Response Body String modifiers Search value n/a Search for a specific keyword in the Response body.
Response Header Header name String modifiers The search value Search for a specific keyword in the explicitly mentioned Response header column.
Cookie Cookie name String modifiers Search value Search for a specific keyword in the explicitly mentioned Cookie.
Magic String The "magic string" content n/a n/a Uses [the legacy Fiddler Classic string literals and regular expressions](https://docs.telerik.com/fiddler/knowledge-base/autoresponder#matching-rules).

Actions

When Fiddler Everywhere identifies a request which matches the Conditions of the rule, it automatically maps it to the Action set in the ruleset.

Apart from returning files or predefined responses, a rule can perform the following specific actions:

Mark Session Choose background color Choose foreground color Sample Preview box Marks the session with selected colors.
Update Request Header Header Name Value modifiers New value Uses the selected value modifier and the new value to update the request header.
Update Response Header Header Name Value modifiers New value Uses the selected value modifier and the new value to update the response header.
Update Request Body Value modifiers New value n/a Uses the selected value modifier and the new value to update the request body.
Update Response Body Value modifiers New value n/a Uses the selected value modifier and the new value to update the response body.
Update URL Value modifiers New value n/a Uses the selected value modifier and the new value to update the current URL.
Update Query Params Query Parameter Key Value modifiers New value Uses the selected value modifier and the new value to update the query parameters.
Update Request Cookies Cookie Key Value modifiers New value Uses the selected value modifier and the new value to update the cookie value.
Update Response Cookies Cookie Key Value modifiers New value Uses the selected value modifier and the new value to update the cookie value.
Predefined Response Drop-down with [predefined responses](/fiddler-everywhere/knowledge-base/using-ar-predefined-actions) n/a n/a Returns the selected predefined response.
Manual Response Text field for creating manual response n/a n/a Returns the manually created response.
Response File File Picker n/a n/a Returns the picked response file.
Do not capture n/a n/a n/a When the Do not capture action is applied, no other actions will be executed.
Delay Request Number value (milliseconds) n/a n/a Delays the request execution with "n" milliseconds.
Graceful Close n/a n/a n/a This action will close the connection gracefully.
Non Graceful Close n/a n/a n/a This action will close the connection forcefully.
Magic String The "magic string" content n/a n/a Uses [the legacy Fiddler Classic string literals and regular expressions](https://docs.telerik.com/fiddler/knowledge-base/autoresponder#matching-rules).

Rules Queue

The Rules Queue, also the Queue Viewer or Queue Rules Viewer, is a queue of the created rules. The Rules Queue allows you to enable or disable, promote or denote, edit, export, import, share, and immediately execute the listed rules.

Rules Priority

By default, the Rules Queue will list all created and imported rules based on their priority. Rules will be executed in the order of their appearance starting from the first one. When selecting specific rules and using the explicit Execute button, they will also be executed in the order they appear in the queue.

Automatic Rules Execution for Live Traffic

To activate all enabled rules, that is a rule with an active toggle, use the Rules toggle from the main toolbar. Note that you have to turn the Live Traffic switch to Capturing mode.

Explicit Rules Execution

To explicitly execute rules on captured sessions, use the Execute button from the main toolbar. The Execute functionality is available for both the Live Traffic and saved sessions.

Rule Options

Each different rule has its panel with the rule name, its toolbar with rule options, a list that previews the set conditions, and a list that previews the set actions.

The rule options allow you to further interact with the rule:

  • The Play button executes the current rule only.
  • The Promote up arrow promotes the selected rule in the Rules Queue.
  • The Demote down arrow demotes the selected rule in the Rules Queue.
  • The Edit button opens the Rule Builder to edit the rule.
  • The Duplicate button creates a duplicate copy of the selected rule.
  • The Share button shares the rule with other Fiddler Everywhere collaborators.
  • The Delete button deletes the rule from the Rules Queue.
  • The Enable/Disable toggle explicitly enables or disables the rule execution. It is available only for Live Traffic sessions and will be hidden when interacting with saved sessions.

Rules tab toolbar

Unmatched Requests Passthrough

The settings of the Rules feature provide options for executing a number of operations.

The Unmatched Requests Passthrough option, which is available in Settings > Rules > Unmatched Requests, controls what happens when a session does not match any of the applied rules. When the option is enabled, the unmatched requests are sent to the server, usually without interference from the Rules tab. When the option is disabled (the checkbox is unchecked), Fiddler will generate a 404 Not Found response for any unconditional requests that are not matching the applied rules.

Unmatched Requests Passthrough

By default, the Unmatch Requests Passthrough option is turned on. Turning it off means that all unmatched requests will start to fail with a 404 (Fiddled) response. For example, Fiddler generated a 404 response due to a request that is not matching the applied rules when the Unmatch Requests Passthrough option is turned off.

Unmatched Request

In this article