CSV

The CSV feature is an file-import based system which allows you to store ENCRYPTED-AT-REST comma-separated-value files containing relevant information for your test cases.

These files can then be imported in your test case workflow as following:

${csv.your_file_name_here.the_column_index_to_extract}

As you can see, it uses the same substitution logic as the one used for extracting/inserting worklow specific headers or responses into your test case, but having a specific namespace in front of it -> csv.

Our load test system extracts for each workflow step in which a CSV file is mentioned a random row from that file, fetches the column_index that you requested and substitutes the value inside the parameter.

The CSV file system can of course be used on the following properties:

  • path

  • header values

  • data (payload)

Here’s how you would use a CSV file with the name csv_file_rungutan which extracts the column value with index 3 in your workflow as a path:

"workflow": [
    {
        "path": "/uuid/${csv.csv_file_rungutan.3}",
        "method": "POST",
        "data": "",
        "headers": {},
        "extract": []
    }
]

The column index starts at 0 of course so basically the “4th column” in your CSV file has the index 3.

PS: The maximum size of a CSV file can be 10 MB.

Permissions

Member role vs API call

List CSV files

Upload CSV file

Download CSV file

Remove CSV file

Reader

True

False

False

False

Editor

True

True

True

True

Admin

True

True

True

True

AdminWithBilling

True

True

True

True

Owner

True

True

True

True

List CSV files

Web

In order to view the CSV files on our platform, all you have to do is browse to the CSV page.

API call

The API call is:

curl -s \
    -d '{"team_id":"my-team"}' \
    -H "X-Api-Key: my_api_key" \
    -X POST \
    https://api.rungutan.com/v1/api/csv/list | jq . -r

{
  "CSV": [
    {
      "csv_id": "affa3935-f47d-48be-a962-ea8db156427d",
      "file_name_csv": "test",
      "member_email": "[email protected]",
      "uploaded_date": "2021-04-12T23:11:41Z",
      "max_rows": "3",
      "max_columns": "4"
    },
    {
      "csv_id": "affa3935-f47d-48be-a962-ea8db156427f",
      "file_name_csv": "test",
      "member_email": "[email protected]",
      "uploaded_date": "2021-04-12T23:11:41Z",
      "max_rows": "6",
      "max_columns": "5"
    }
  ]
}

You can also filter based on csv_id to get the summary for only that specific csv_id:

curl -s \
    -d '{"team_id":"my-team", "csv_id": "csv_id"}' \
    -H "X-Api-Key: my_api_key" \
    -X POST \
    https://api.rungutan.com/v1/api/csv/list | jq . -r

{
  "CSV": [
    {
      "csv_id": "affa3935-f47d-48be-a962-ea8db156427d",
      "file_name_csv": "test",
      "member_email": "[email protected]",
      "uploaded_date": "2021-04-12T23:11:41Z",
      "max_rows": "3",
      "max_columns": "4"
    }
  ]
}

CLI

List all csv keys:

$ rungutan csv list
{
  "CSV": [
    {
      "csv_id": "affa3935-f47d-48be-a962-ea8db156427d",
      "file_name_csv": "test",
      "member_email": "[email protected]",
      "uploaded_date": "2021-04-12T23:11:41Z",
      "max_rows": "3",
      "max_columns": "4"
    },
    {
      "csv_id": "affa3935-f47d-48be-a962-ea8db156427f",
      "file_name_csv": "test",
      "member_email": "[email protected]",
      "uploaded_date": "2021-04-12T23:11:41Z",
      "max_rows": "6",
      "max_columns": "5"
    }
  ]
}

Filter based on csv_id:

$ rungutan csv list --csv_id affa3935-f47d-48be-a962-ea8db156427d
{
  "CSV": [
    {
      "csv_id": "affa3935-f47d-48be-a962-ea8db156427d",
      "file_name_csv": "test",
      "member_email": "[email protected]",
      "uploaded_date": "2021-04-12T23:11:41Z",
      "max_rows": "3",
      "max_columns": "4"
    }
  ]
}

Upload CSV file

Web

In order to upload a new CSV file, all you have to do is browse to the CSV page and click on the upload csv button.

API call

This action is not available through an API call.

CLI

This action is not available through an API call.

Download CSV file

Web

In order to download an existing CSV file, you have to browse to the CSV page and click on the “Download CSV” button for the relevant file.

API call

The API call is:

curl -s \
    -d '{
        "csv_id": "csv_id",
        "team_id": "my-team"
        }' \
    -H "X-Api-Key: my_api_key" \
    -X POST \
    https://api.rungutan.com/v1/api/csv/get | jq . -r

{
    "Url": "https://link-to-download-csv",
    "ResultsMetadata": {
        "team_id": "my-team",
        "csv_id": "csv_id"
    }
}

CLI

Get URL to download via CLI:

$ rungutan csv get --csv_id affa3935-f47d-48be-a962-ea8db156427f
{
    "Url": "https://link-to-download-csv",
    "ResultsMetadata": {
        "team_id": "my-team",
        "csv_id": "csv_id"
    }
}

Remove CSV file

Web

In order to download an existing CSV file, you have to browse to the CSV page and click on the “Remove CSV” button for the relevant file.

API call

The API call is:

curl -s \
    -d '{
        "csv_id": "csv_id",
        "team_id": "my-team"
        }' \
    -H "X-Api-Key: my_api_key" \
    -X POST \
    https://api.rungutan.com/v1/api/csv/remove | jq . -r

{
    "message": "Successfully deleted CSV file"
}

CLI

Get URL to download via CLI:

$ rungutan csv get --csv_id affa3935-f47d-48be-a962-ea8db156427f
{
    "message": "Successfully deleted CSV file"
}