> For the complete documentation index, see [llms.txt](https://docs.apica.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apica.io/platform-docs/zebratester-scripting/zebratester-user-guide/2.-scripting-the-load-test-session/2.-correlation-dynamic-session-parameters/2b.-configuring-variable-rules.md).

# 2b. Configuring Variable Rules

## Variable Rules <a href="#id-2b.configuringvariablerules-variablerules" id="id-2b.configuringvariablerules-variablerules"></a>

| Users can create rules for variable extraction and assignment (global settings) and these rules can be applied to the recorded session (. **prxdat**) at any time. These configuration settings are found in the **Personal Settings** dialog. |   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| After clicking the Configure Var Rules button the following Variables Rule Configuration Dialog Box will appear:                                                                                                                               |   |

### Add A Rule <a href="#id-2b.configuringvariablerules-addarule" id="id-2b.configuringvariablerules-addarule"></a>

Add a Boundary-based rule or Regex-Based Rule.

| **Field, Definition, and Procedure**                                                                                                                                                                                                                                                                                                                                                                                                                                                               | **Screenshot**                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>Rule Name</strong>: The name of the rule to be added. The rule name should be unique for each rule.</p><p><strong>Variable Prefix</strong>: The prefix to be used while creating automatic variables based on this rule. The variable prefix should be unique.</p>                                                                                                                                                                                                                      | **Extract from**: Where to extract the variables from. There are two options: (1) Response Header and (2) Response Content. If the **Response Header** is selected, the var extractors will be created from *response headers*. If **Response Content** is selected, the var extractors will be created from *response content*. |
| **Rule Type**: The type of rule to be added. There are two options - Boundary Based Rule and Regex Based Rule.                                                                                                                                                                                                                                                                                                                                                                                     |                                                                                                                                                                                                                                                                                                                                  |
| **Boundary Based Rule details**: These details will be used to extract a text based on the left and right boundaries inside the HTTP response header/content.                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                  |
| **Regex Based Rule details**: These details will be used to extract a text based on the configured regular expression inside the HTTP response header/content.                                                                                                                                                                                                                                                                                                                                     |                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>Assign Var Options</strong>: Configures how the automatically-created vars will be assigned. There are two options<br>1. Assign Var automatically to all HTTP requests which contain the same text pattern (<em>full binary replacement of recorded value over all the requests</em>).<br>2. Assign var automatically to all HTTP requests which contain form or CGI parameters with the same recorded value. You can also try to match URL encoded text.</p>                           | If the Assign with **{$Var Name}** pattern is checked, the assignment in the request (URI, headers and Content) will be replaced by **{$Var Name}** pattern                                                                                                                                                                      |
| Once you click on the **Add Rule** button, the new rule will be listed in the List of Rules section. By default, the newly-added rule will be enabled.                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                  |
| <h3 id="id-2b.configuringvariablerules-delete-modify-enable-disablerules">Delete, Modify, Enable, Disable Rules</h3>                                                                                                                                                                                                                                                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                  |
| <h3 id="id-2b.configuringvariablerules-modifyarule"><strong>Modify a Rule</strong></h3><p>Once a rule is added and in place, it can be modified by clicking on the Modify icon to the left of the Rule name within the List of Rules section</p><p>Note: The Rule Type cannot be modified.</p><h3 id="id-2b.configuringvariablerules-deleterule"><strong>Delete Rule</strong></h3><p>To remove a rule, click on the Delete icon to the left of the Rule name within the List of Rules section.</p> | <h3 id="id-2b.configuringvariablerules-enable-disablerule"><strong>Enable/Disable Rule</strong></h3><p>Click on the toggle buttons to enable or disable a rule.</p><p>Note: Only the enabled rules will be applied to the recording to create automatic vars.</p>                                                                |

### **Applying the Rules** <a href="#id-2b.configuringvariablerules-applyingtherules" id="id-2b.configuringvariablerules-applyingtherules"></a>

A new **Apply Var Rules** icon in the Main Menu will allow you to replace all existing variables automatically.

| **Directions**                                                                                                                                                   | **Screenshot** |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| Click on the **Apply Var Rules button** once the recording of a session is completed to apply the enabled rules on that recording.                               |                |
| It will automatically create Var extractors from Response header/content and Var assigners to Request header/content based on the enabled rules after recording. |                |
