Skip to content
API & network

API testing

HTTP requests inside your tests, with checks on the response, values reused by later steps, cURL and Postman import, and API collections.

An API request step sends an HTTP request during the test and checks the answer. Mix it with page steps — create data through the API, then check it on the page — or build a test made only of API requests.

Build a request

Requests are built in the API tab of the dock (with a wide dock, the request is on the left and the response on the right):

  • Method and URL. A relative URL (/users) uses the active environment. Next to the method choose Site (the base URL) or API (the environment’s API URL, for APIs on another host such as api.example.com).
  • Params, Headers and Body — JSON, form, multipart with files, or text.
  • Auth — Bearer, Basic or API key.
  • Every value accepts dynamic data, saved variables, {{env:…}} and secrets from the { } menu.

Add to test adds the request as a step, at the insert point if you set one with Record from here, otherwise at the end. On the card, Send tries it and Open brings it back to the API tab to change it. A test with API steps can be saved without recording, and the API requests filter of the Action History shows only them.

Try it with Send

Send sends the request at once, without running the test: you see the status, time, headers and the JSON body as a tree. Send uses the active environment (variables, secrets, generated values) but keeps cookies of its own — Reset forgets them — so it never uses or changes the browser’s session.

Checks and saved values

  • Checks on the response: status, a header, a value of the JSON, the text, the time. Each can be soft.
  • In the response tree, hover a value and click + check to check it, or save to keep it as {{name}} for later steps — API or page steps (a token, a new id).
  • After Send, every check shows ✓ or ✗.

cURL and the Network tab

  • cURL in the API tab turns a pasted cURL command — from Postman, from the browser (Copy as cURL, bash or cmd) or from API docs — into a request. You can also paste it straight into the URL field. Headers added by the browser are dropped, the URL becomes relative to the environment and Bearer or Basic credentials go to Auth; a preview shows what changed.
  • >_ copies the request as a cURL command (bash or cmd), to try it in a terminal or in Postman.
  • In the Network tab, on a call made by the page: API step opens it in the API tab with a check on the status seen; cURL copies it.

Import from Postman

Import Postman collection (icon in the Tests and API sections of the Project tab) reads a collection exported from Postman (v2.1) and, optionally, its environment. Choose Import as: Tests or API collection.

  • Every request becomes an API step. The checks written in the scripts (status, JSON values, headers, time) become checks, and values saved by the scripts — the login token — become {{variables}} for the next requests.
  • One test per folder, or a single test for the whole collection when a value saved in one folder is needed in another.
  • From the environment: the server address becomes the base URL (or API URL) of a project environment, secret variables become secrets and the others environment variables.
  • A preview lists the tests that will be created (and those they replace) and the conversion notes. What can’t be converted — pre-request scripts, logic — stays as a comment on the step. File fields of forms must be chosen again.

API collections

The API section of the Project tab holds collections of requests in folders, saved in the project but outside the tests — like Postman. + creates a collection, Import imports a Postman collection.

  • Click a request to open it in the API tab; try it with Send and keep it with Save (● marks unsaved changes, Revert drops them). A request you are building is kept with Save to collection.
  • Right-click: Add to test copies the request into the open test; Create test makes a test with every request of a collection or folder; rename, duplicate, move, delete.
  • Collections are not included in the export.

When the test runs

  • In Headless and In-App runs, API calls share cookies with the page: a login through the API signs in the page too, and the other way round.
  • A test made only of API requests runs once, without a browser window: the Output tab shows an API badge and the mode, speed and browser choices are disabled. Breakpoints still work, between one request and the next.
  • Secrets stay hidden as •••••• everywhere. Manual Steps and Gherkin describe each request in one line.
  • Environments with HTTP auth send the credentials to API steps too, only on the environment’s site.
API testing — Actify Studio Docs