refill data set
Refill an in-use data set with new data from an external text file. Each row of the data set is derived from a row in the text file.
Name | Description | Type | Modifier |
---|---|---|---|
data set | Name to assign to the filter. | String | None |
text file | Full file system path to an external text file on the test controller containing the data rows in tab-delimited format. | String | None |
None
This action may be used within the following project items: test modules, user-defined actions
Example - Case 1: Dedicated data sets
name
use data set /Rented Cars
 
text
report #"Quantity " & quantity rented & " of model " & model rented & " rented in " & pickup state & " in " & rental month
 
repeat for data set
 
data set text file
refill data set /Rented Cars d:\refill_data.txt
 
name
use data set /Rented Cars
 
text
report #"Quantity " & quantity rented & " of model " & model rented & " rented in " & pickup state & " in " & rental month
 
repeat for data set
Result
Example - Case 2: Inline data sets
name
create data set Rented Cars
 
  rental month model rented pickup state quantity rented
row March Prius Colorado 1
row June Mustang Nevada 3
 
end create data set
 
name
use data set Rented Cars
 
text
report #"Quantity " & quantity rented & " of model " & model rented & " rented in " & pickup state & " in " & rental month
 
repeat for data set
 
data set text file
refill data set Rented Cars d:\refill_data.txt
 
name
use data set Rented Cars
 
text
report #"Quantity " & quantity rented & " of model " & model rented & " rented in " & pickup state & " in " & rental month
 
repeat for data set
Result
- This action does not modify any values in a dedicated or inline data set. Instead, the effect of this action is to cause the data for the subsequent use data set action to be sourced from the external file rather than the specified data set.
- This action is applicable to both dedicated and inline data sets.
- The external text file and the specified data set must both exist.
- The external text file must have one record (data set row) per line, with tab-delimited fields in each line. The number of fields (that is, total columns separated by tab characters) per line must match the number of columns in the data set.
- Each line of the text file represents one data record, which populates the variables upon each iteration of the use data set / repeat for data set loop.
- This action supports the <ignore> modifier. If the string
<ignore>
is present as the value of any of the arguments, or any argument contains an expression that evaluates to<ignore>
, the action is skipped during execution.