SpitfireLoad Testing & APMWhat's new

Test data

For every VU to use a different account, product id or TC kimlik number, values come from four places: CSV data files, fake data generators, values extracted from a response, and test variables.

Data sources

Source Syntax Where it is defined When it changes
Test variable {{base}} Editor → General & variables → Variables Fixed in the test; can be changed per environment or run
Data file column {{users.email}} Data files + editor → Data (CSV) A new row every iteration
Fake data {{fake.email}} Nowhere; written directly A new value on every use
Extracted value {{token}} Step → Extract Every time the step runs
Built-in values {{__VU}}, {{__ITER}}, {{$uuid}}, {{$randInt 1 100}}… Built in (full list) On every use / every iteration

How to upload a CSV data file

  1. On Load Testing → Test resources → Data files (Data files In Spitfire: /data-files) click Upload CSV.
  2. Choose the file in CSV file (the first row is the header; rules are in Details).
  3. Type a Name and click Upload CSV.
  4. Success check: the file appears in the list with its columns and row count; the eye icon (Preview) shows the first 20 rows and Used by tests.

Data files pageData files page

Upload a data file dialogUpload a data file dialog

Example users.csv:

csv
email,password,customer_id
ayse.demir@example.com,Test1234!,100231
mehmet.kaya@example.com,Test1234!,100232
zeynep.yilmaz@example.com,Test1234!,100233

Preview dialog: the first 20 rows and the tests using the filePreview dialog: the first 20 rows and the tests using the file

How to generate a data file

Generate thousands of rows without real customer data.

  1. Click Data files → Generate data.
  2. Enter a Name and Rows (1-50,000).
  3. Pick the value kinds (TC kimlik number, IBAN (TR), Mobile phone, First name, Last name, E-mail, Province, District, Address, Date); give From and To for Date, and a Column name if needed.
  4. Click Generate and save. The file is added to the list and bound like an uploaded CSV.

The columns of one row describe one person (the e-mail is made from the name, the district belongs to the province); {{fake.*}} makes independent values on every use.

Generate test data dialogGenerate test data dialog

How to bind a data file to a test

The shortest way: on Data files, click Bind to a test on the file's row and pick the test. The editor opens with the file bound; the {{name.column}} variables are copied with a click.

From the editor:

  1. Open the test and click General & variables → Data (CSV) → Add a data binding.
  2. Type a Name (e.g. users; name rules are in Details).
  3. Pick the File and the Mode. The syntaxes are listed under the row: {{users.email}}, {{users.password}}.
  4. Use them in steps, e.g. in the login body {"email": "{{users.email}}", "password": "{{users.password}}"}.
  5. Check with Try it, then save.

Data (CSV) section on the General & variables tabData (CSV) section on the General & variables tab

Every iteration takes one row from each binding; all steps of that iteration see the same row. In JSON (the editor fills in dataFileId):

json
"data": [
  { "name": "users", "dataFileId": "8d3c1f6e-2b7a-4f1e-9c55-0a6b2e4d9f10", "mode": "unique" }
]

Binding modes

Mode JSON How it works When
Sequential sequential Rows are handed out in order and wrap around. Most cases.
Random random A random row every iteration; rows can repeat. Read-heavy tests, id lists.
Unique unique Each row is used at most once in the whole run. When they run out, VUs stop starting iterations and the run ends at its planned time. Single-use coupons, users that can register only once, data loading.

Several runners

Mode Several runners
Sequential Each runner takes its own contiguous part of the file; with more runners than rows every runner uses the whole file
Unique Each runner takes its own contiguous part, no two runners use the same row; with more runners than rows they do not use the whole file
Random Every runner gets the whole file
Warning

In Unique mode, if there are fewer rows than the run's iterations, the load drops when the rows run out but the run goes on until its planned end. Check the total iterations on the plan chart and prepare the file for it; for "process every row once" jobs use the shared-iterations model.

In comparative runs

  • In A/B runs Unique bindings are split into equal halves: A takes the first half, B the second (with an odd number of rows the last row is not used).
  • With Sequential and Random both sides read the whole file.
  • In a sequential comparison every turn takes its own equal slice of a Unique file.

Fake data

Fake data is synthetic Turkish data generated on the runner during the test. It goes in any template field and gives a new value on every use.

Syntax Value
{{fake.tckn}} An 11-digit TC kimlik number whose check digits are valid
{{fake.iban}} A TR IBAN with a valid mod-97 check digit and a real bank code
{{fake.phone}} A mobile number, +905XXXXXXXXX
{{fake.firstName}}, {{fake.lastName}}, {{fake.fullName}} Turkish first name, last name, full name
{{fake.email}} name.surname42@example.com (example domains that receive no mail)
{{fake.city}}, {{fake.district}} Province and district (all 81 provinces)
{{fake.address}} An address like Cumhuriyet Mah. Lale Sk. No: 12 Daire: 3, 35040 Bornova/İzmir
{{fake.date}} A day between 1960 and 2005 (YYYY-MM-DD)
{{fake.date 2024-01-01 2024-12-31}} A day in the given range (both ends included)

Expand Synthetic test data (fake.…) in a step card and click a button to copy the syntax to the clipboard.

Fake data buttons in a step cardFake data buttons in a step card

A TC kimlik number or IBAN passes checksum validation but is random and belongs to no real person or account; don't use them outside testing. Rules are in Details.

How to carry values between steps

An extractor carries a value from a response to later steps (Test editor).

  1. Make the login step Run once per VU; {{users.email}} and {{users.password}} in the body; Extract: token ← JSONPath $.access_token.
  2. create_order: header Authorization: Bearer {{token}}; Extract: orderId ← $.id.
  3. get_order: URL {{base}}/api/orders/{{orderId}}.
  4. In Try it, look at each step's "Extracted" variables and the Final VU variables at the bottom.

Extracted values in the Try windowExtracted values in the Try window

The scope (a copy per VU, across iterations, what happens when not found) is in Details.

Passwords and sensitive values

There is no separate secret vault for templates:

Value Where to keep it Why
Database, Kafka, RabbitMQ, Redis, MongoDB, gRPC passwords A saved connection under All integrations → Connections Stored encrypted, never enters the test definition; the step only holds the connection's name.
Client certificate and key (mTLS) All integrations → Add integration → Client certificate (mTLS) The key is stored encrypted and never enters the test definition.
Test users' passwords A CSV data file or a test variable Both unencrypted: variables in the test definition, the JSON and the version history; a CSV is visible in Preview. Use test accounts with limited rights.
API key, token Where possible, extract it from a login step The token is obtained during the run, not stored in the test.
Values given with Change variables for this run No production secrets Recorded on the run and shown on the run page.
Failed request samples If responses can contain personal data, Options → Failed request samples → Off: responses must not be stored Query values that look like secrets and URL passwords are masked, cookies are never kept.

Full example

Login with a user from the CSV, registration with fake data, and chaining with extractors:

json
{
  "version": 1,
  "name": "Customer registration and order",
  "variables": { "base": "https://shop.staging.example.com" },
  "data": [
    { "name": "users", "dataFileId": "8d3c1f6e-2b7a-4f1e-9c55-0a6b2e4d9f10", "mode": "sequential" }
  ],
  "options": {},
  "scenarios": [
    {
      "name": "register_and_order",
      "executor": { "type": "constant-vus", "vus": 20, "duration": "5m" },
      "steps": [
        {
          "id": "login",
          "name": "Login",
          "once": true,
          "protocol": "http",
          "request": {
            "method": "POST",
            "url": "{{base}}/api/login",
            "body": { "type": "json", "content": "{\"email\": \"{{users.email}}\", \"password\": \"{{users.password}}\"}" }
          },
          "extract": [ { "var": "token", "from": "jsonpath", "expr": "$.access_token" } ],
          "checks": [ { "type": "status", "op": "eq", "value": 200 } ]
        },
        {
          "id": "add_customer",
          "name": "Add customer",
          "protocol": "http",
          "request": {
            "method": "POST",
            "url": "{{base}}/api/customers",
            "headers": [ { "key": "Authorization", "value": "Bearer {{token}}" } ],
            "body": { "type": "json", "content": "{\"tckn\": \"{{fake.tckn}}\", \"name\": \"{{fake.fullName}}\", \"phone\": \"{{fake.phone}}\", \"iban\": \"{{fake.iban}}\"}" },
            "modifiesData": true
          },
          "extract": [ { "var": "customerId", "from": "jsonpath", "expr": "$.id" } ],
          "checks": [ { "type": "status", "op": "in", "value": [200, 201] } ]
        },
        {
          "id": "get_customer",
          "name": "Read customer",
          "protocol": "http",
          "request": {
            "method": "GET",
            "url": "{{base}}/api/customers/{{customerId}}",
            "headers": [ { "key": "Authorization", "value": "Bearer {{token}}" } ]
          },
          "checks": [
            { "type": "status", "op": "eq", "value": 200 },
            { "type": "jsonPath", "path": "$.id", "op": "exists" }
          ],
          "thinkTime": { "min": "1s", "max": "2s" }
        }
      ]
    }
  ],
  "thresholds": [
    { "metric": "req_failed", "expr": "rate<0.01" },
    { "metric": "req_duration", "expr": "p(95)<600" }
  ]
}

In SQL steps values go into Parameters, not into the query; data columns and fake data can be parameters:

json
"sql": {
  "query": "SELECT id, status FROM orders WHERE customer_id = $1 ORDER BY created_at DESC LIMIT 10",
  "params": [ "{{users.customer_id}}" ]
}

SQL step form: query and parametersSQL step form: query and parameters

Details

Topic Note
CSV header The first row is the header. Column names are letters, digits or _ and do not start with a digit (email, customer_id); no non-ASCII letters, spaces or hyphens
CSV limits A column name cannot appear twice; at most 100 columns; at least one data row after the header; the file is at most 20 MB. The BOM in Excel's "CSV UTF-8" output is not a problem
Deleting a file A file used by a test cannot be deleted ("It cannot be deleted while a test uses it."); remove the data binding from those tests first
Binding name Letters, digits, _; not starting with a digit; unique in the test; fake cannot be used
Row consumption A scenario consumes rows only from the bindings its own steps use
The same fake value twice {{fake.email}} twice in the same step gives two different e-mails. For the same value, create a file with Generate data and bind it, or send the value in one step and extract it from the response
Fake data errors An argument to a generator that takes none ({{fake.tckn 5}}) or an unknown name ({{fake.tc}}) is a template error; the message lists the known names. In a date range the end cannot be before the start
Extract: VU Every VU has its own copy of the variables; one VU's token does not pass to another
Extract: iterations An extracted value stays in the VU's later iterations; that is how the token of a login step marked Run once per VU is used in all iterations
Extract: not found The value does not linger from the previous iteration: it falls back to the extractor's default, otherwise to the test's variable of the same name, otherwise to an empty string

Common problems

The most common case: all VUs log in as the same user, because the e-mail comes from a test variable. Add a data binding and use {{users.email}}.

Symptom Cause Fix
On upload: column name email-address must be letters, digits or _ and not start with a digit A hyphen, space or non-ASCII letter in the header Rename the column, e.g. email_address, and upload again.
the file has no data rows (the first row is the header) There is only a header row Add at least one data row.
not a valid CSV file: … A semicolon separator, an unclosed quote or different column counts Save the file with a comma separator as "CSV UTF-8".
the file is larger than 20 MB The file limit is exceeded Drop unneeded columns, or split the file and use separate bindings.
users has no column mail (columns: email, password) The template's column is not in the file Write it with the file's name (case-sensitive).
unknown variable {user.email} The binding name is misspelled (user instead of users) Match the binding's Name and the template.
data file not found (it may have been deleted) / "(file not found)" in File The file was deleted, or the test came from another installation Pick an existing file in the File list.
fake is reserved for the generated test data (fake.tckn, fake.iban, …); choose another name A data binding is named fake Choose another name.
Load dropped in the middle of the run, VUs idle The rows ran out in Unique mode Upload more rows, or switch to Sequential.

Next: Test editor, Load model, Runs and results.