Search Parameter is used to search for a particular string in the response message of the server. Users can send this searched string in the subsequent request messages. To search the desired string, provide the left boundary and right boundary. The pattern which lies in between these defined boundaries is searched and is stored in a Search Parameter variable.

## Adding the Search Parameter

The following fields need to fill to add the Search Parameter in the script:

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 {}.

1. Boundary
   - Left Boundary(LB): Left Boundary is the starting pattern that is provided to search any particular string. To search any string, the left pattern is searched first. When its existence is verified only then the right pattern is searched. It is an optional field.
   - Right Boundary(RB): Right Boundary searches for the ending pattern i.e. occurrence of this pattern terminates the search and the data lying between Left Boundary and Right Boundary is the value of the Search Parameter. It is an optional field.
   - Ignore Case: If you check this box then the string to be searched in LB and RB becomes non-case-sensitive.
2. Regex
   - Regular Expression: A regular expression is a sequence of characters that specifies a match pattern in any particular string.
   - Group: In regular expressions, a group is a portion of the pattern enclosed in parentheses. Groups are used to capture and match specific sub-patterns within the larger pattern. They allow you to extract or manipulate specific parts of the matched text. Group value can lie in the range 0-100.
3. Advanced Boundary:/ It is similar to a boundary field. The only difference is that you can also use the binary number, regular expression, and parameter as left boundary and right boundary to search any particular string.

Search Text in page response: The user can specify on which response page he/she wants to search the string.

## Occurrence Count

When the data to be searched is present more than once on the response page(s), then the user can specify which occurrence should be picked by the Load Test. By default, it is set to 1. This means it picks the first occurrence. There are the following options:

- Index: In Index, you 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: This option captures all occurrences of the pattern and saves them in Search Variable in the form of an array.
- ANY: This option picks data randomly from any one of the occurrences of the pattern.
- ANY NON-EMPTY: This option picks data randomly from any one of the occurrences but not the Empty value of the pattern.
- Last: This option picks the last occurrence of the pattern.

## Advanced

You have to click the Icon to view all the options in the Advanced section. You will get the following option in Advanced:

- Retain value from previous page if not found in current page: This option provides a facility to users by which they can able to retain the previous value if it is not found in current page. This options are disabled by default. If you want to retain the previous value you can enabling this option.
- Start Offset: This is required only if a part of the searched value is assigned to the parameter. It indicates the start of offset. The offset value must be non-negative. You can also start offset from the first character of the searched value by selecting from the Beginning check box.
- Maximum Length: It indicates the end of offset. You can also end offset till the last character of the searched value by selecting till the end check box.
- LB Match: This option is used to select LB in case of multiple LBs. Using this option, the user can select the LB that he wants to use. It contains the following options:
  - FIRST: Select the first left boundary which is to be matched within the particular string from the multiple left boundaries.
  - CLOSEST: Select the left boundary which is nearest to the right boundary.
  - INTEGER: In the case of an integer, it will select the left boundary on the basis of the integer value that will be given by the user.
- Conversion: This option is used for converting the searched data to some other format. By default, there is no conversion. So, the data is placed in the request as it is. But if the user wants to convert this data into URL format, then this option comes into the picture. If the search parameter is used in the URL portion, then all of the special symbols are encoded. But if the search parameter is used in the BODY portion, then to encode special symbols, the following 'Header' should be used on that particular page:

  HEADER=Content-Type: application/x-www-form-urlencoded.

  You can use the following conversion options which are optional and are listed below:

  - HTML to URL
  - HTML to Text
  - Text to URL
  - URL to Text
  - URL to HTML
  - Text to HTML
  - Text to Base64
  - Base64 to Text
  - Text to Hex
- Search in: By applying 'Search Parameter', Load Test searches on the response page. If the user wants to search some data in the value of any 'Search Parameter Variable', in that case 'Search in' is used i.e. 'Search in' searches in the value of the search parameter variable. User can have the following options:
  - Body
  - Header
  - all
  - Parameter

- 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 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 report and event.log and terminates further processing.
- Redirection Depth: This option is used when you want to search the pattern in the URL which is moved to some other location. Let suppose one URL is redirected 5 times, it will search the pattern in All locations, in a particular location and in the last location. There are the following options which are listed below:
  - LAST: If this option is selected, Load Test searches on the last location.
  - ALL: LoadTest searches the pattern on all the locations.
  - Numerals ranging 1 to 32: If you select any number which is in the range 1 to 32, LoadTest searches only for that particular numbered location.

## Encode Parameter for Request URL/Body

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. User 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 ‘+’.