Import external data

Imagine you want to do a GET or a POST with different parameter values, can the player handle this ?

Of course the answer is yes ! At the top level of your script, you can define a unique feeder which name is a CSV file. The only requirement is that the first line of this CSV file must indicate the column names. These column names will be used to populate variable names with the same name (so the column name must follow the variable name syntax: the first character must be a letter or an underscore, the following characters may be any letter, digit or underscore character).

Here is a definition of a feeder file:

feeder:
  type: csv
  filename: /path/to/file.csv
  separator: ","

For now, only CSV files are allowed.

Let's take an example now. Imagine you have a CSV file named /tmp/data.csv which contains these lines:

firstname,lastname,city
John,Doe,Chigago
Alice,Jones,New York
Jim,Black,Roma

Now, you can use these data to parameter the requests of your script, for example:

actions:
  - http:
      title: Send user request
      method: GET
      url: http://my_server/page.php?firstname=${firstname}&lastname=${lastname}&city=${city}

Each time a VU plays this action, the variables will be substituted by the values read from the CSV file. Once the end of the file is reached, the values are read again from the beginning of the file.