Load Test XML variables are initialized as a result of searching a response document for user-specified criteria. Any pattern appearing within the XML node would be used to initialize the value of the XML Load Test variable.

## Adding XML Parameter

The following fields need to be filled to add XML parameters in the script.

### Parameter Details

- Parameter Name : This field is used to set the name of the Parameter, which is used in the parameterization of the script with curly braces { }.
- XML Node Path: This specifies the XML node. The most common nodes in XML are Document Node, Element Node, and Attribute Node.

### Select Pages for XML Parameter

The user can specify on which response page he/she wants to apply the XML parameter. Users can select any one of the following options:

After filling in the above fields, you have to select any one of the following:

Find : It has two options:

- Node: It finds the value of the XML node path provided above. It is elected by default.
- Attribute: It specifies the attribute value with a specified key. If the user selects the Attribute option, he/she needs to specify the attribute key.

After selecting any one of the above, we can add Selection Criteria. When the user clicks on Add Selection Criteria, a Where clause is added. User can select either node or attribute with value and Value with key respectively. User can add multiple conditions according to their requirement.

## Advanced

The user will get the following fields in Advanced:

### Occurrence Count (ORD)

It provides the number of times the searched string appears on the answer document (within the defined left and right boundary). It comes in handy when the same left and right boundaries occur on a response page several times. User can select any one of the following as per the requirement from the drop-down:

- Index: In Index, user can select any particular occurrence from the list of Index. For eg- if there are 10 occurrences of patterns, then you can select the 5th or sixth one from the index file.
- All: It specifies to collect all occurrences of patterns between left and right boundaries. In this case, the svar_count variable contains the count of occurrences. svar_1 contains the first occurrence; svar_2 contains seconds and so on.
- Any: It specifies, that any one of the matched patterns is selected and stored in svar.
- Last: In this, the last matched occurrence is selected. For eg- if there are 15 occurrences, then the 15th one will be selected.

After selecting one of the above options, we have the following checkbox:

### Conversion

It is used to encode the search pattern. You will get the following option:

- HTMLToURL: Converts HTML-encoded data to a URL-encoded data format. Here, HTML to URL conversion means text to URL conversion i.e. URL encoding.
- UrlToHtml: Converts URL-encoded data into HTML encoded data.
- HtmlToText: Convert HTML-encoded data into plain data. (called HTML-decoding

Example- HTML-encoded data: &lt;03/01/1987&gt;

After conversion into plain data: <03/01/1987>

- TextToUrl: Converts plain text data into URL-encoded data. (called URL - encoding)

Example- plain HTML data: <03/01/1987>

After conversion into URL encoded data: %26lt%3B03%2F01%2F1987%26gt%3B

- UrlToText: Converts URL-encoded data into plain text data. It is just reverse of TextToUrl (called URL-decoding).
- TextToBase64: Converts plain text data into base64-encoded data

Example: Plain HTML data: <03/01/1987>

After conversion into base64 encoded data: ICAmbHQ7MDMvMDEvMTk4NyZndDsgIA==

- Base64ToText: Converts base64-encoded data into plain text.

### Redirection Depth

If RedirectionDepth=Last is specified and the server response is redirection information (HTTP status code 300-303, 307), then the response is not searched. Instead, after receiving a redirection response, the GET request is sent to the redirected location and the search is performed on the response from that location. This attribute is optional. Empty RedirectionDepth is not allowed. Default value is Last.

- Last: If this option is chosen, Load Test searches on the last redirection.
- INumerals ranging 1-32: Load Test searches only up to the depth which is equal to the numeral selected.
- All: Load test searches till the last redirection depth.

### Action on not Found:

It is the handling option when a boundary is not found and an empty string is generated.

- Error causes an error to be raised when a boundary is not found and stops the search.
- Warning does not issue an error. If the boundary is not found, it sets the parameter count to 0, and continues executing the script. The "warning" option is ideal to see if the string was found, but do not want the script to fail.

### Encoding Option

Encoding is used to encode special characters to their ASCII value.

Users can encode any number of special characters i.e. all, specific, or none. Users can have the following options:

- Encode all special characters except (+), (-), (.), (_): All special symbols except + - . _ are encoded. It is the default value.
- Encode only specified characters: The user can specify which special characters to encode in Characters to encode
- Do not encode special characters: None of the special characters is encoded. However, space is encoded always.

Encode Space By: This option specifies to Load Test how to encode Space. User can have two options: ‘+’ or ‘%20’. If ‘+’ is chosen, Load Test encodes Space by ‘+’ and if ‘%20’ is chosen, Load Test encodes Space by ‘%20’. The default value is ‘+’.

Notes :

1. If your values contain special characters that you prefer not to encode, you have the choice of using either "Do not encode special characters" or "Encode only specified characters." A practical illustration of this situation can be found in the domain name https://www.cavisson.com, which includes special characters such as (:/).