Importing
What it does
Start a test from the file you already have. Files are never run, only read; an imported test opens in the editor before you save it.
| Source | From |
|---|---|
k6 script (.js, .mjs, .ts), JMeter plan (.jmx), Spitfire test (.json) |
Tests → Open file (several files open Bulk import) |
| OpenAPI 3.x, Swagger 2.0, Postman collection, GraphQL, HAR | Tests → Import API / HAR |
| Access log or trace export | Tests → From real traffic |
Import buttons on the Tests page
Only admins see the import buttons; the user role cannot create tests.
k6 and JMeter
How to import a k6 or JMeter script
- On Tests click Open file and pick the
.js/.mjs/.tsor.jmxfile together with the CSV files the plan reads (CSV Data Set). - The editor opens it as a New test; the summary N parts not converted, M to check. shows at the top.
- Click Show the report (N): note converted, check not exactly, not converted add it by hand.
- Go through Review before saving and click Save.
How to run without converting
When the report lists too much that is not converted, run the file on its own engine. The engine must be on (Turning an engine on).
- In the conversion box press Run natively with k6 (or Run natively with JMeter).
- Check the summary on the Scenarios tab.
- Save and start a short run. Success check: the run's steps are the script's requests (the sampler names for JMeter).
Details: Running a k6 script as it is.
What converts from k6
| k6 | Spitfire |
|---|---|
options (executors, vus/duration, stages, thresholds) |
Load model and thresholds. Without options, 1 VU, 1 iteration. |
http.get/post/put/patch/del/head/options/request |
A step with headers and body |
check(), sleep() |
Check, think time |
res.json(...), res.headers[...] |
Extraction |
__ENV, __VU, __ITER |
Test variable (with its default) and equivalents |
Requests inside setup() |
Steps that run once per VU (check) |
http_req_duration, http_req_failed, http_reqs |
req_duration, req_failed, reqs. Threshold syntax and CI exit codes match k6. |
for with constant bounds (the bound may be a const) |
repeat block |
if / else / else if |
if block (===, !==, <, >=, &&, !, .includes(), null; a response value read becomes a variable such as res_status) |
if (Math.random() < 0.3) |
choice block (30% / 70%) |
http.batch([...]), http.batch({ name: ... }) |
parallel block (object keys become step names) |
SharedArray, papaparse.parse(open('users.csv'), { header: true }) |
CSV binding users: user.email → {{users.email}}; picked with Math.random() gives random, with __ITER sequential |
Not converted: while, do, for...of and loops without constant bounds, conditions with ||, CSV read without { header: true }, functions with arguments, k6/metrics, WebSocket/gRPC modules, teardown().
What converts from JMeter
| JMeter | Spitfire |
|---|---|
| Thread Group | Scenario: duration with ramp-up → ramping-vus, duration without ramp-up → constant-vus, loop count → per-vu-iterations. An endless group with no duration becomes a 10-minute constant-vus (with a warning). |
| HTTP Request, HTTP Request Defaults, HTTP Header Manager | Step |
| Response, Duration, JSON Assertion | Check |
| JSON, Regular Expression, XPath, Boundary, CSS Selector Extractor | Extraction (first match; a different Match No. becomes check) |
| Constant, Uniform Random, Gaussian Random Timer | Think time |
User Defined Variables, ${__P(name,default)}, __Random, __UUID, __time, __threadNum |
Test variables and equivalents |
| Transaction / Simple Controller | Steps in order, named like Cart / Pay |
| Loop Controller | repeat block |
| If / While Controller | if / while block (simple comparisons, __jexl3, __groovy are read; while runs at most 100 rounds) |
| Switch, Random, percent Throughput Controller | choice block (Throughput 30% → 30% / 70%) |
| Module / Include Controller | Requests copied in (select the Include's .jmx with the plan) |
| JSR223 (Groovy) and BeanShell | vars.put(...) becomes an extraction, AssertionResult.setFailure(true) and assert become checks |
| Once Only Controller | Runs in a VU's first iteration only |
| Random Order, Interleave, ForEach, Runtime | In order, every iteration (check) |
| CSV Data Set Config | Data binding: ${email} → {{users.email}} |
Not converted: an Include Controller whose .jmx was not selected with the plan, setUp/tearDown groups, non-HTTP samplers, JavaScript scripts. Listeners are ignored.
CSV Data Set
- In Open file, select the
.jmxtogether with the CSV files the plan reads. - Each CSV whose name matches is stored under Data files
In Spitfire: /data-filesand bound. - Look for CSV data set … became the data file … bound as "users" in the report.
If you did not select the CSV, a not converted line names the file and the binding; upload the CSV and bind it with that name on the editor's Data tab.
JMeter plans have no thresholds; POST, PUT, PATCH, DELETE requests from k6/JMeter come with This request changes data on the target ticked. Add thresholds, and untick POSTs that change no data (login, search), or every run asks for confirmation.
How to bulk import
- Select several files in Open file, or click Add files on Bulk import (k6, JMeter,
.json, CSV and included.jmxfiles may be mixed). - Open a row whose Status is to fix with Fix in the editor.
- Tick the rows (Select all ready ones) and click Save selected (N).
A whole folder from the command line:
spitfire convert <folder> -o tests/ -r report.csvIt writes one test file per script and a CSV report; upload the CSV next to a .jmx under Data files In Spitfire: /data-files.
How to build a test from an API document
Importing from an API document
- Click Tests → Import API / HAR.
- Type the URL in From URL or pick From file. A Swagger UI, Redoc or Scalar page works too (Documentation page address).
- Click Read. For GraphQL give the endpoint itself (GraphQL).
- Pick the Methods to take (only GET by default).
- Type your test environment's address into Test name and Base URL; it becomes
{{base}}. - For protected requests fill Sign-in (authentication) and click Try sign-in (Sign-in).
- Tick the operations and click Create a test with N steps.
- If you picked requests that change data, confirm each group, type the host shown exactly and press I confirm, create the test.
- In the editor fill empty variables with Go to variables and save (Path variables).
- Success check: in Try every step returns the expected status code and no URL keeps an empty variable such as
/orders/.
The generated test: one step per operation, 1 VU for 1 minute, a Status check for the success code on every step. Limits and authentication mapping are in Details.
Documentation page address
When the address returns HTML, Spitfire looks for the document on the page itself. When found, Found on the documentation page:
shows. When not, paste the page's JSON / OpenAPI download link or upload the file with From file.Path variables
Path parts such as {orderId} become test variables ({{base}}/orders/{{orderId}}). Without an example, default or enum in the document the value stays empty; Spitfire does not make values up.
- In the notice at the top of the editor, I added N variables (orderId, …); enter their values., click Go to variables.
- Type a value that really exists on the target. When each VU needs a different one, use a data file.
Postman scripts
A collection's Tests scripts are read; collection and folder scripts apply to every request under them. Converted lines land under the step's Extract and Checks, a check taking its name from pm.test("…").
| Postman | Spitfire |
|---|---|
pm.environment.set("token", pm.response.json().data.token) (any scope, JSON.parse(responseBody) too) |
token ← JSONPath $.data.token |
pm.environment.set("rid", pm.response.headers.get("X-Request-Id")) |
rid ← header X-Request-Id |
pm.response.to.have.status(200), pm.response.to.be.ok |
Status check |
pm.expect(pm.response.text()).to.include("x") |
Body contains check |
pm.expect(j.user.role).to.eql("admin") |
JSON field check |
pm.response.to.have.header("Content-Type") |
Header / metadata check |
pm.expect(pm.response.responseTime).to.be.below(800) |
Latency (ms) check |
Not converted: if/loops, postman.setNextRequest, console.log, values not taken from the response.
Postman pre-request scripts
The common lines of Pre-request scripts become template values and are put where {{name}} is used in the requests the script applies to.
| Postman | Spitfire |
|---|---|
pm.environment.set("x", "fixed") / pm.environment.get("y") |
fixed (also the default for other requests) / {{y}} |
Date.now() / Math.floor(Date.now() / 1000) / new Date().toISOString() |
{{$timestamp}} (ms) / {{$unix}} / {{$isoTimestamp}} |
uuid.v4(), crypto.randomUUID(), {{$guid}} |
{{$uuid}} |
_.random(1, 9), Math.floor(Math.random() * 100) |
{{$randInt 1 9}} |
CryptoJS.HmacSHA256(msg, key).toString() (SHA1, SHA512, MD5; Base64 output too) |
{{$hmac sha256 key msg}} |
CryptoJS.MD5(x).toString() / btoa(x) |
{{$hash md5 x}} / {{$base64 x}} |
pm.request.headers.add({key: "X-Sig", value: …}) |
That header, on every request the script applies to |
The arguments of $hmac, $hash, $base64 must be variables; undefined ones come empty. A value is made where it is used: a request that uses {{x}} twice gets two different UUIDs. Not converted: pm.sendRequest, if/loops, a signature of pm.request.body, two statements on one line.
Sign-in (authentication)
A document says how a request authenticates, not where the token comes from. The options:
| Option | What it does |
|---|---|
| Login operation | A POST whose path is like /login, /signin, /auth/token, /sessions, or whose response documents a token; the likeliest is picked |
| OAuth2 | The document's password and client credentials flows |
| Give the token myself | Every request sends the same value |
| Leave empty for now | You fill the variables in the editor |
With a login or OAuth2, the test starts with a sign-in step that runs once per virtual user. The token goes into {{token}} from Where the token is in the response (JSONPath) (default $.token, $.access_token for OAuth2).
Try sign-in sends the request once from the controller; the token is never shown:
| Outcome | What to do |
|---|---|
| Signed in (HTTP 200), the response has a token. | Ready. |
| The server answered HTTP 200 but no token is at that place | Correct Where the token is in the response (e.g. $.data.accessToken). |
| The server answered HTTP 401 | Check the credentials. |
| The controller couldn't reach it | If the address is only on the runners' network the test is still made; make sure the runners can reach it. |
A password, client secret and Basic credentials go to variables starting with secret_; they are encrypted on save and only shown masked. Use a separate test user for load tests, not a production account.
How to record in the browser
The Spitfire Recorder Chrome extension records the flow you click through, masks sensitive values and sends the recording to Spitfire.
Setup
- Install it with Open in the Chrome Web Store on the Tests → Import API / HAR → Record in the browser tab.
- In extension → Settings enter the Spitfire address (
https://spitfire.yourcompany.com, HTTPS orhttp://localhost) and an API token (Profile → API tokens). - Allow the permission Chrome asks for.
Recording
- Open the site and press Start recording in the extension. Add your API domain to the list if it differs.
- Go through the flow; name pages with New step (Login, Cart).
- Press Stop, then Send to Spitfire. The import page opens the recording.
Closing Chrome's debugging bar at the top stops the recording.
Review
| Part | What happens |
|---|---|
| Correlations | Values a response returned and later requests sent back (CSRF token, JWT, __VIEWSTATE, a new record's id). Each one you accept becomes an extractor on its source step and a variable such as {{csrf}} later on |
| Move to test data | Values you typed (user name, search term) move to a one-row CSV and become {{data.username}} |
| Masked values | Passwords, Authorization / API key headers, card numbers and Turkish ID numbers are masked before the recording leaves the browser; they become empty variables such as {{secret_password}} |
How to build a test from a HAR file
Developer tools → Network → go through the flow → Save all as HAR.
Pick the file with Tests → Import API / HAR → From file and click Read.
The rest is the same as Test from an API document.
What a HAR turns into is in Details.
How to build a test from real traffic
Create a test from real traffic
- Click Tests → From real traffic.
- Choose the Log or trace file; you can leave Format on Detect the format.
- Click Read and pick a Time window (Busiest hour or Whole file work too).
- Look at the Endpoint mix table (
/orders/123→/orders/:id). - Type your test environment into Base URL; change Scale factor (2 = twice the observed traffic) and Endpoints in the test if needed.
- Click Create the test. Endpoints that change data ask for confirmation.
Each endpoint becomes a ramping-arrival-rate scenario that follows its own observed rate. Logs have no bodies or headers: add them and the credentials in the editor.
Review before saving
The most common mistake: saving and running while {{base}} still points at production. Before saving:
- Check that
{{base}}and the other URLs point at the test environment. - Fill empty variables such as
token,secret_basicAuth,apiKey,authToken. - Check that steps with This request changes data on the target really change data.
- Add thresholds; JMeter and document imports have none.
- Send one iteration with Try it, then click Save.
Details
| Topic | Note |
|---|---|
| Report | Messages are in English. The box at the top says Converted from file.js (k6) |
| Running without converting | The test switches to the engine and the file is uploaded |
| CSV matching | By name, without folders, ignoring case; Variable Names become the header row. With Recycle on EOF off the mode is unique, otherwise sequential |
| Bulk import | Each file is converted and validated on a row; to fix means a validation error |
| Reading from URL | The controller must reach the URL |
| Document size | OpenAPI, Swagger and Postman v2.0/v2.1 (JSON or YAML) 10 MB, HAR 50 MB |
| GraphQL | The controller sends the introspection query; if introspection is off, upload its result as a JSON file |
| Methods | If you add POST, PUT/PATCH, DELETE, those requests repeat on every iteration |
| Base URL | Type your test environment's address, not the suggested server |
| Confirming requests that change data | Goes to the audit log with the user, time, IP, the document's SHA-256 and the list of operations |
| Authentication | Becomes a header: Bearer → Authorization: Bearer {{token}}, Basic → {{secret_basicAuth}}, API key → {{apiKey}}. Code documentation such as JSDoc or Javadoc is not supported |
| Searching a documentation page | Document links on the page (Redoc spec-url included), the Swagger UI config (url: / urls:) and /openapi.json, /swagger.json, /v3/api-docs, /api-docs on the same server; at most 12 addresses |
| Path variable value | When the document gives an example, default or enum, that is filled in; the notice shows each variable's state |
| Browser recording: domain | The open tab's domain is recorded by default (*.example.com for shop.example.com) |
| Browser recording: step names | Step names prefix the request names |
| Browser recording: privacy | The recording stays in your browser and your Spitfire. Cookies, static files and analytics requests are not recorded |
| HAR | Static files and CORS preflights are left out. The token a login returned becomes Authorization: Bearer {{token}} on later requests, and pauses become think time |
| HAR: cookies and tokens | Cookies are dropped (a recorded session cookie would turn every VU into the same user). A token no response produced is replaced by an empty {{authToken}}. Every origin becomes a variable ({{base}}, {{base2}}) |
| Real traffic: file | Up to 512 MB. Formats: nginx, JSON log, AWS ALB / Classic ELB (.gz too), CSV (method,path,status,latency,timestamp, latency in ms), OTLP JSON, Jaeger JSON |
| Real traffic: settings | Scale factor 0.01-100; Endpoints in the test default 20, at most 50 |
| Real traffic: privacy | The file is not stored and client addresses are not read |
Common problems
| Symptom | Cause | Fix |
|---|---|---|
| file.json is not a Spitfire test definition | The JSON is an OpenAPI or Postman file | Open it with Import API / HAR. |
| Empty test, or no thread group with an HTTP request could be converted | Requests sit in a Module/Include Controller or a k6 loop | Read the report, add the requests by hand; use the load model for repetition. |
| Reading From URL fails | The controller cannot reach the URL, or it needs a login | Download the file and upload it with From file. |
| The document is no longer loaded; read it again. | A document stays in the controller's memory for at most an hour | Click Read again. |
| The target host you typed does not match the host the test writes to. | The host typed differs | Type the name shown exactly (comma-separated when several). |
| A test from a document gets 401 | The sign-in step gets no token, or Leave empty for now was chosen | Look at the sign-in step's response, fix the login_… variables and the JSONPath (Sign-in). |
| A test from HAR gets 401 | {{authToken}} is empty or the login is not in the recording |
Record the login too, or fill authToken. |
| A real-traffic test gets 404 | Base URL points at production, or a path value does not exist in the test environment | Fix Base URL, fill variables such as {{orderId}} with valid values. |
Next: HTTP, WebSocket, SSE and GraphQL, SQL (importing .sql and pg_stat_statements), External engines.

