Aller au contenu principal

Importing Postman & Insomnia Collections

Aethrix can import API collections from Postman, Insomnia, and Bruno — converting them into fully executable Aethrix test automation projects. Folders become test suites, requests become test cases, and scripts are preserved with compatibility sandboxes so they can run verbatim.

How to Import​

  1. In the Test Automation toolbar, click Import Collection (download).
  2. The Import Collection wizard opens with three steps.

Step 1 — Source​

FieldDescription
Collection file or folderBrowse to a Postman/Insomnia file or a Bruno collection folder
Output folderWhere the generated .aprj project is written

Supports Postman (.postman_collection.json), Bruno (collection folder), and Insomnia (Insomnia_*.json / .yaml).

Step 2 — Options​

OptionDescription
Flatten folders into a single test suiteIgnore folder hierarchy and place all requests under one suite
Generate typed object models from requests (recommended)Build typed models for best fidelity
OpenAPI / Swagger spec (optional)Provide a real spec for the highest type fidelity; otherwise Aethrix infers models from requests and example responses

Step 3 — Import​

Shows a live log and a summary such as:

{0} request(s): {1} typed / {2} generic, {3} response schema(s) inferred.

When finished, choose Open Project to load the result into the workspace, or Close.

Supported Formats​

SourceFormatFile Pattern
PostmanCollection v2.1*.postman_collection.json
InsomniaExport v4 (JSON or YAML)Insomnia_*.json, Insomnia_*.yaml, Insomnia_*.yml
BrunoCollection directory*.bru (folder with bru.json manifest)

What Gets Converted​

Source ElementAethrix Result
Collection info.nameProject name
Folders (nested item arrays)Test suites (preserving hierarchy)
Requests (item with request)Test cases with Send Request steps
request.method + request.urlHTTP method and URL
request.headerRequest headers
request.body (raw, formdata, urlencoded, graphql)Request body with content type
request.auth (bearer, basic, apikey, oauth2, digest)Authentication configuration; OAuth2 produces a pre-step
event.listen: "prerequest"Pre-request JavaScript step
event.listen: "test"Post-response JavaScript step
Collection variable arrayDefault test environment variables
{{variableName}} syntax${variableName} syntax

Script Handling​

Postman and Insomnia scripts receive special treatment during import:

Structured Assertion Extraction​

Common assertion patterns are detected and converted into native Aethrix assertion steps attached to the Send Request step:

Script PatternExtracted Assertion
pm.response.to.have.status(200)HttpStatusCode equals
pm.expect(pm.response.code).to.equal(200)HttpStatusCode equals
pm.response.to.have.header("Name")Header exists
pm.response.to.have.header("Name", "Value")Header equals
pm.expect(json.path).to.eql(value)JsonPath equals
pm.expect(body).to.include("text")Body contains
pm.expect(json.field).to.existJsonPath exists

Variable Extraction​

pm.environment.set("key", expr) and pm.collectionVariables.set("key", expr) calls are detected. When the expression is a simple .json().field access, a Data Transfer step is created to extract the JSON path value into the named variable.

Remaining Script Content​

Script lines that do not match a known detection pattern remain as raw JavaScript in a JavaScript Test Step. At runtime, these scripts execute against the pm or insomnia compatibility sandboxes, which provide the expected API surface.

Variable Translation​

Postman/Bruno-style {{variableName}} syntax is automatically converted to Aethrix ${variableName} syntax in URLs, headers, bodies, and script content.

Compatibility Sandboxes​

At runtime, every JavaScript test step has access to three sandbox objects:

ObjectSourcePurpose
aethrixNativeUse for new scripts — full Aethrix assertion API
pmPostmanPostman-compatible API for imported collection scripts
insomniaInsomniaInsomnia-compatible API for imported collection scripts

The pm and insomnia sandboxes are compatibility layers — they allow imported scripts to execute without modification. For new scripts, prefer aethrix.*.

See the JavaScript API Reference for the complete API surface.

Limitations​

  • Only Postman Collection v2.1 format is supported (not v1 or v2.0)
  • Only Insomnia v4 export format is supported
  • Complex scripts using dynamic property access or non-standard patterns may not produce structured assertions — they execute verbatim but assertions won't appear as separate steps
  • Postman collectionVariables map to Aethrix environment variables (not a separate scope)
  • Bruno assertion extraction is limited to res.status, res.headers, and res.body patterns

Importing cURL Commands​

In addition to collections, you can paste a raw cURL command:

  1. In the API Playground toolbar, click Import cURL.
  2. The Import cURL window (ImportCurlWindow) opens with a multi-line text area. Paste the full command, e.g. curl -X POST https://api.example.com/v1/users -H "Content-Type: application/json" -d '{"name":"Ada"}'.
  3. Click Import — Aethrix parses method, URL, headers, and body (including --data-raw and --header variants) and creates a new request under Imported cURL Requests.

:::info Screenshot needed — light/dark 📸 import-curl-window-light.png and import-curl-window-dark.png — Import cURL window with pasted command and parsed preview :::

See Also​