CSV Reader
This variable reads a CSV file and provides a new row from the CSV file each time it is accessed.
The CSV files must have headers for each column, since these are used to reference the value.
Format
Value is the path, relative to requests/
, of an file ending with .csv
.
Arguments
repeat
bool (optional) - whether values should be reused, e.g. when reaching the end it should start from the beginning again (default:False
)random
bool (optional) - if rows should be selected by random, instead of sequential from first to last (default:False
)
Example
requests/example.csv
username,password
bob1,some-password
alice1,some-other-password
bob2,password
And value for variable "AtomicCsvReader.example" is "example.csv | random=False, repeat=True"
Then post request with name "authenticate" to endpoint "/api/v1/authenticate"
"""
{
"username": "{{ AtomicCsvReader.example.username }}",
"password": "{{ AtomicCsvReader.example.password }}"
}
"""
First request the payload will be:
{
"username": "bob1",
"password": "some-password"
}
Second request:
{
"username": "alice1",
"password": "some-other-password"
}
etc.
atomiccsvreader__base_type__
def atomiccsvreader__base_type__(value: str) -> str
Validate values that AtomicCsvReader
can be initialized with.