The plugin provides the ability to work with CSV files.
Property Name | Acceptable values | Default | Description |
---|---|---|---|
|
<char> |
|
The char used for value separation, must not be a line break character |
|
<char> |
|
The char used to escape special characters in values, may be disabled |
Note
|
The table transformers properties marked with bold are mandatory. |
FROM_CSV
transformer generates table from the given CSV file.
Parameter | Description |
---|---|
|
The relative path of the CSV file |
|
The char used for value separation, must not be a line break character |
If delimiterChar
is not set, then the corresponding property will be used during parsing.
{transformer=FROM_CSV, csvPath=/data/example.csv}
{transformer=FROM_CSV, csvPath=/data/another-example.csv, delimiterChar=;}
Saves CSV string to indexed zero-based variable with column name mappings, e.g. var[0].key2, var[1].key1 etc. Please see the documentation for more information about complex variables.
When I save CSV `$csv` to $scopes variable `$variableName`
-
$csv
- CSV string. -
$scopes
- The comma-separated set of the variables scopes. -
$variableName
- The name of the variable to save CSV string.
Given I initialize scenario variable `csv` with value `key1,key2,key3
val1-1,val1-2,val1-3
val2-1,val2-2,val2-3`
When I save CSV `${csv}` to scenario variable `expected-csv`
When I save CSV `#{loadResource(/data/simple-csv.csv)}` to scenario variable `actual-csv`
Then `${expected-csv}` is equal to `${actual-csv}`
Then `${csv-from-file[1].key2}` is equal to `val2-2`