JSON or JavaScript Object Notation is an open standard format that uses human-readable text to transmit data objects consisting of "attribute": "value" pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML.

## Adding JSON Parameter

The following fields need to be filled to add JSON Parameter:

### 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 { } . It is a mandatory field.
- Object Path: This specify the full path of the node value the user needs to be fetched. For example, if the user needs to get the value of node email which is under root, then Object Path should be "root.email".

### Pages

If All Pages is selected, Load Test searches for the specified pattern in all the pages, starting from the first page. If Specified is selected then Load Test searches for the pattern only in the selected and specified pages.

### Occurrence Count

It is required if multiple occurrences are found of a specified node. The user has four options for this.

- Index: By selecting this, the user can define which index of occurrence needs to pick.
- All: If the user selects this option then the system takes all occurrences of the specified node.
- Any: It takes randomly any one occurrence out of all.
- Last: It takes the Last occurrence.

### Advanced

- Start Offset: This is required if only part of the delimited value needs to be assigned to the parameter. It defines the starting position of the portion, which needs to be extracted. (0 indicates the first character, 1 indicates the second, and so on) The offset value must be non-negative.

From the beginning: Check this box if you need the offset from the beginning.

- Maximum Length: This is the length of a sub-string of the found value, from the specified offset, to search in the parameter. The default is 0, indicating until the end of the string.

Till the end: Check this box if the Maximum Length is till the end.

### Action on Not Found

If the pattern, for which Load Test is searching, is not found, then the user can make Load Test behave in the following ways:

- Warning: If this option is used and the pattern for which Load Test is searching is not found, then Load Test displays an error message in event.log and continues its operation.
- Error: If this option is used and the pattern, for which Load Test is searching is not found, then Load Test displays CVFail in progress.report and event.log and terminates further processing.

### Conversion

This option is used to encode search patterns. It has following options:

- None: In this option, no encoding is applied.
- HTMLToURL: It converts HTML-encoded data to a URL-encoded data.
- HTMLToText: It converts HTML-encoded data to plain text format.
- TextToUrl: It converts TEXT-encoded data to URL format.
- UrlToText: It converts URL-encoded data to plain text format.
- UrlToHtml: It converts URL-encoded data to HTML text format.
- TextToBase64: It converts Text data to Base64 format.
- Base64ToText: It converts Base64 data to Text format.

- Redirection Depth: If the page, on which Load Test is searching the pattern, is moved to some other location, then this option is used. It specifies how many moved locations Load Test is supposed to search for the pattern i.e. up to what redirection depth Load Test searches the pattern.
  - Last: If this option is chosen, Load Test searches on the last redirection.
  - Numerals ranging 1-32: Load Test searches only up to the depth which is equal to the numeral selected.

### Encoding Option

- Encode only Specified Character:
  - Specify the characters to encode in the 'Character to Encode' box.
  - Mention how to encode the space either by '+' or '%20'.
- Encode all special characters except (+) (-) (.) and (_): All the special characters are encoded except (+) (-) (.) and (_).
- Do not encode Special Character: Special characters are not encoded on selecting this option.

Note: JSON path should start with "root.".

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 (:/).