A Data Collection is a set of variables that can be edited and used as input or output values during macro or test execution: 64 variables can be defined and an unlimited number of records (rows) can be added.
The Data Collections window displays the list of existing collections of data with several configurable columns like:
- Name (must be unique)
- Number of defined lines (records)
- Last run of this collection of data
In order to manage data collections, 5 buttons are available: Add, Edit, Delete, Import & Export
- The Add button allows to create a new Data Collection.
- The Edit button allows to edit an existing Data Collection. it is disabled if the data collection is currently edited by another user or running within a scheduler task.
- The Delete button allows to delete Data Collection. It is disabled if the data collection is under use in a scheduler task or edited by another user.
- The Import button allows to import a csv file where each column is a constant and each line a new record used for each iteration of macro or test. The first line will define the constant names.
- The Export button allows to export the information into a csv file: names only, or names and values can be exported.
The column headers have default values for the variable names from ‘$1’ to ‘$64’, but each variable name can be edited and modified to match the names used inside a macro or a test. The maximum length of a variable name is 1024 characters.
Before a test is scheduled, the scheduler checks that the proper data collection contains all the necessary variables for the execution: if one of them is missing, the test is not scheduled and is rejected with a syntax error.
By default all the 64 variables are named $1 to $64. All variables can be renamed. The name must always start by ‘$’ character and be written with any character but ‘$’ character as the second.
The maximum length of a variable name is 1024 characters.
All variables are created and initialized as an empty string. If a column is added to a data collection it will add 64 cells of empty string. This empty string is converted as a 0 (zero) in case of numeric conversion if needed during test execution. It is always possible to initialize variables with a SET action during test execution. The actions (SET, NUM & TEXT) will only update the current cell value and not all the rows of a variable.
To uses the first column of a variable the default syntax is $VarName where VarName is the name of the variable defined in the Data Collection edit window.
To use a specific column of a variable the syntax is $VarName:ColNumber, where ColNumber is the index of the variable columns starting to 1. To use the first variable column the ColNumber is not mandatory. So $Var is equivalent to $Var:1, but to use other columns, the column number is mandatory with for example $Var:2, $Var:3 etc… In the variable syntax, the ColNumber can also be replaced itself by a variable name to have $Var1:$Var2. This case means to get the ColNumber contained in $Var2 for the variable $Var1. The indirection level is limited to 2, so the syntax $Var1:$Var2:$Var3 is not permitted.
To be used in a test or a macro the variable columns must have been previously created (added) with the Data Collection edit window.
The default row 1 used in case of default variable syntax "$VarName" will change in case of test iterations defined in the scheduler. The default column number is replaced by the test iteration number. So during the first loop "$VarName" correspond to the column 1 of "$VarName", during the second test loop "$VarName" correspond to the column 2 of "$VarName" and so on.
Some constants are defined in the Test Manager and can be used in parameters fields and as value in Data Collection.
|@RAND||random value between 0 to 32678|
|@DATE||Current date YY/MM/DD|
|@TIMESTAMP||Number of second since 01/01/1970|