## Data Set

Datasets are used to source the parameter values from data files. This is a very common method for getting data from an external file.

## Parameter Details

- Parameter Name:Unique name for the parameter. You can give multiple parameter by comma separated in case file has multiple fields g: Name, Address.
- Header Line Number: it is used to define the header line in the given file. In some situations, consider first few lines as headers. System does not consider these lines as data lines while picking data from file. By default, header line is 0
- Column Delimiter: This field specifies which character in data file should be considered as column separator. By default, column delimiter is ','. You can use special symbols as column delimiter.
- First Data Line: In some situations, you might want to start reading data from a particular line number. Therefore, you can use this field to indicate which line it should consider as first Data Line. By default, first Data Line is 1.
- Fetch Parameters From Header: It is to get the parameter names form header line of dataset contents by splitting it by Column Delimiter. You can define header line in the text box. Example: If header line is Name, AccountNo, CreditCardNo, Balance and column delimiter is "," then parameters names is Name, AccountNo, CreditCardNo and Balance.
- Dataset File Name: indicates the file name. In case you are creating file then name can sart with number, characters and no limit of max chars to be used
  - View: This option is used to view a dataset file.
  - Choose: By selecting this option, the user can choose an file from their local server.
  - Import: By selecting this option, the user can import file from the database server. Once the user selects this option, a dialog box appears in which the user has to enter following details:
    - Database Type: It is the type of the database which is to be used.
    - URL Prefix: It is the prefix of the URL.
    - URL: It is the main URL.
    - User ID: It is the username to connect.
    - Password: It is the password to connect.
    - Query: In this field, the user has to provide the query for getting the data from the database.
- Dataset Contents: displays the content of the file. You can either input content or can get from existing file from the server by specifying Dataset File name and click on View. If the user wants to enter the contents in the tabular format, then the user has to click on the Table Format checkbox.

## Advanced Settings

- Update Value on: There are two modes available:
  - SESSION: Here the value of the variable is initialized only once during a session at the time of first use & is not changed during the session. Means the parameter is set once for each service request. It does not depend on how many times this parameter is used in response template.
  - USE: In this option value of the parameter is set every time it is used in the response template.
- Row Selection Mode: There are 2-modes are available:
  - Sequential: to select rows sequentially from the beginning of file to the end of file.
  - Random: to select any row randomly from the file.
- Parameter Fields whose value is from file: In this field, multiple parameter values can be provided.

e.g. (Fn=<value> or<filename>)

Where n specifies the index number to refer the parameter name, default value for parameter values is value.

Example: If dataset contents are:

/home/cavisson/user1,LA
/home/cavisson /user2,CA
/home/cavisson /user3,NY
In parameter value, user provides F1=file,F2=value

It means first parameter value comes from file which is specified in first field and second parameter value is as specified in the second field. File can have any data (one or many lines) and the whole file content is the value of the first field. It is useful when parameter value can have multiple data lines or its data can have the file separator for example address.

Notes

1. You cannot save a blank file or provide blank dataset contents. While doing so, an error message "Please enter dataset content" is displayed.

   FILE is a mandatory argument and data-file-name specifies the file name containing the list of values for the variable(s) being declared. Format of the value file is as follows:

   - If there is only one variable being defined in the declaration, the file contains list of values with one value on a single line.
   - If multiple variables are being defined, a value of all variables would be defined on a single line and the values would be separated by ",". Effectively, each row contains a set of values for each variable declared. The order of values in a row should correspond to order of variable names in the declaration.
   - f the file name is a relative path (not starting with /), it is assumed relative to service directory of the test script to which these variables belong.