## About

The template is used for defining the response of the service. By default, every service has one template, which is used for the response of the service. One service can also have more than one response based on the request or the test conditions. In this case, the user needs to add multiple templates.

## Adding Template

To add a template, enter the following fields:

- Template Name: Enter the template name in this field. It is the unique name of the template within this service.
- Response Template: It is the response of this service for this template. User can parameterize it later using different types of parameters. From the drop-down the user can select following action:
  - Replace selected text by a parameter: On selecting this option, the selected text will be replaced by a parameter.
    1. cav_cur_date: It will replace the selected text with the date parameter.
    2. cav_http _method: It will replace the selected text with http methods.
    3. cav_sequence: It will replace the selected text in a particular sequence.
    4. cav_regex_url_match_pattern: It will replace the selected text with the URL pattern.
    5. select:
    6. Search_param: It will replace the selected text with the URL’s search param interface.
  - Replace selected text by sequence number: On selecting this option, the selected text will be replaced by the sequence number.
    1. Enter start sequence number: This indicates the start of the sequence number which the user has to provide that will indicate from where the text will be replaced.
  - Mark selected text by repeatable block: On selecting this option, the selected block will be repeated.
    1. Select the block repeated upon: This option will select the text on which the block will be repeated.
    2. Value of the Parameter: It shows the value of a parameter.
    3. Number of Occurrence of parameter: It will show occurrence number of the parameter.
    4. Fixed Number: The selected block will be repeated for fixed number.
  - Replace selected text by data parameter: On selecting this option, the selected text will be replaced with date format.
    1. Format : Select text will replace by format.
    2. Offset : Enter the offset number.
  - Add request parameter and replace selected text by it: On selecting this option, the added request parameter will be replaced with the selected text.
    - Attribute Name : Enter the name of the attribute.
  - Add query parameter and replace selected text by it: On selecting this option, the added query parameter will be replaced with the selected text.
    - Query Name : Enter the query name.
  - Add XML parameter and replace selected text by it: On selecting this option, the added XML parameter will be replaced with the selected text.
    - XML Node Path : Enter the XML Node path.

Note: Once a user selects any parameter, their corresponding parameter name will

- Sample Request: Sample request of the service. This is used for testing and for selection of Prefix and Suffix in Request Parameters.
- Beautify: Click the beautify icon ( ) which formats the content. From the dropdown select either of CSS, Text, HTML, Javascript, XML or Json as per the requirement.

### Selecting Condition of a Template

If more than one template is used, then user needs to provide condition for the selection of all additional templates. Conditions can be defined based on variable values or request. Select following argument for the condition:

- Parameter Name: Parameter name to be used in the condition.
- Type: Type of parameter – String or Numeric.
- Condition Operator: Select condition operator:
  - Equal To
  - Not Equal
  - Greater Than
  - Less Than
  - Greater Than Equal To
  - Less Than Equal To
- Value: Select any parameter or constant value.
- Click Add to add this condition.
- To add more conditions for this template, select Logical Operator (AND or OR) and add condition using above steps.

Click the Save button to save the template and to go back to Templates window.