2b. Configuring Variable Rules

Variable Rules

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

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

Field, Definition, and Procedure

Screenshot

Field, Definition, and Procedure

Screenshot

Rule Name: The name of the rule to be added. The rule name should be unique for each rule.

Variable Prefix: The prefix to be used while creating automatic variables based on this rule. The variable prefix should be unique.

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.

Assign Var Options: Configures how the automatically-created vars will be assigned. There are two options
1. Assign Var automatically to all HTTP requests which contain the same text pattern (full binary replacement of recorded value over all the requests).
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.

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.

Delete, Modify, Enable, Disable Rules

Modify a Rule

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

Note: The Rule Type cannot be modified.

Delete Rule

To remove a rule, click on the Delete icon to the left of the Rule name within the List of Rules section.

 

Enable/Disable Rule

Click on the toggle buttons to enable or disable a rule.

Note: Only the enabled rules will be applied to the recording to create automatic vars.


Applying the Rules

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

Directions

Screenshot

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.

 

 

Can't find what you're looking for? Send an E-mail to support@apica.io