CSV Input Files


Input files use a CSV structure to simplify managing test input. CSV fields are used in command sequences and are referenced by field number during load tests.

Upload CSV input files in the Errthquake portal on the Test Assets page.

Basic CSV Input Example

user1,password1,abbeyroad,The Beatles,Abbey Road,42.58
user2,password2,thriller,Michael Jackson,Thriller,25.71
user3,password3,nightattheopera,Queen,A Night at the Opera,39.23
user4,password4,darksideofthemoon,Pink Floyd,The Dark Side of the Moon,48.99
user5,password5,ziggystartdust,David Bowie,Ziggy Stardust,31.84
user6,password6,somegirls,The Rolling Stones,Some Girls,37.62
user7,password7,hwy61revisited,Bob Dylan,Highway 61 Revisited,29.38
user8,password8,purplerain,Prince,Purple Rain,21.97

This example defines 6 CSV fields which become 6 attributes for a virtual user, and are referenced by substrings {$1}..{$6} in command sequences.

In this example command configuration, the {$1} and {$2} fields populate the username and password, and the {$3}..{$6} fields are used in a json request body:

Commands:

  userauth:
    Url:  https://auth.myservice.com/token
    Method: POST
    Headers:
      Content-Type: "application/x-www-form-urlencoded"
    BodyText: 'username={$1}&password={$2}&grant_type=password&audience=my-app'
    RegexVals:
      TOKEN: '"id_token":"(\S+?)"'

  metadata:
    Url:  https://api.myservice.com/content
    Headers:
      Authorization: "Bearer {%TOKEN}"
    Method: POST
    BodyText: '{ "permalink": "{$3}", "title": "{$4}", "description": "{$5}", "price": "{$6}" }'

A Note on Security

Errthquake stores assets on encrypted file systems, but test configurations and inputs are viewable as plain text in the web portal.

Virtual users in a load test typically access accounts in test tier applications rather than production, and typically control disposable resources. Password security may be a secondary concern if an account's scope is sufficiently limited.

When load test passwords need to be secured, defining several passwords in Errthquake Secrets and using them for test accounts is a better strategy.

CSV File Considerations

CSV Format Considerations

Commas in CSV input

Surround a field with double quotes when the field contains a comma:

user9,password9,historybook1,Michael Jackson,"HIStory: Past, Present and Future, Book I",25.96

Double Quotes in CSV input

Precede double quotes with another double quote to "escape" them in CSV input:

user10,password10,fetchtheboltcutters,Fiona Apple,""Fetch the Bolt Cutters"",33.25

Multiline CSV input

Surround a multiline field with double quotes:

user11,password11,livebbcvol2,The Beatles,"Live At the BBC
Volume 2",25.78