Automation and testing
Use a collection for a repeatable set of requests, a chain when one response supplies the next request, and a schedule when a saved request needs to run regularly.
Run a collection
Open the collection runner, choose an environment and set the number of iterations. Add a delay between requests if needed, and choose whether a failed request or assertion should stop the run. Start the run and inspect each result as it arrives.
To vary the input, load a CSV file with column headers or a JSON array of objects. For example:
orderId,expectedStatus
1001,200
1002,404
A request to {{baseUrl}}/orders/{{orderId}} receives the row's orderId. Read the expected status in a post-request script with pm.iterationData.get("expectedStatus"). Each row supplies one iteration.
The result records request status, duration and assertion failures. Run history keeps the data file name and row count. Export JUnit XML for CI tools or HTML for a readable report. Review reports before sharing, especially if the API returns personal or confidential data.
Write a focused script
A pre-request script prepares values before the call. A post-request script checks the response. This example belongs in the post-request editor:
pm.test("Expected status", function () {
const expected = Number(pm.iterationData.get("expectedStatus") || 200);
pm.expect(pm.response.code).to.equal(expected);
});
if (pm.response.code === 200) {
const body = pm.response.json();
pm.environment.set("orderId", String(body.id));
}
Use pm.response.text(), pm.response.json(), pm.response.headers.get("Content-Type") and pm.response.responseTime to inspect results. The scripting API also offers pm.environment, pm.variables, pm.collectionVariables, read-only pm.request metadata, pm.iterationData, pm.test, Chai-style pm.expect assertions and console.log.
pm.sendRequest can make an additional HTTP call with a callback. Its callback completes before the function returns. Scripts run in a JavaScript sandbox with a five-second execution limit and no Node.js modules or .NET access. Check imported scripts against these APIs; compatibility does not mean every Postman extension is available. Collection-level scripts and editable collection-level authentication are not supported.
Pass values through a chain
Create a chain, add saved requests in the required order and select an environment. Add a JSONPath extraction such as $.id to store a response value as orderId; the next step can use {{orderId}}.
Conditions can check whether a variable exists, equals a value or contains text, combining checks with AND or OR. A condition skips a step when it is not met. Choose stop-on-error if later steps depend on a successful earlier one. Review the run details to distinguish a failed step from a skipped step.
Create a desktop mock
Open the mock editor, create a server entry and add routes with a protocol, method or operation, path, response and optional delay. Templates, route duplication and the precedence check help build a consistent set of routes. You can also save a recorded HTTP response as a route.
HTTP routes can use an exact response or generate data from a contract. Review generated examples and scenarios, and use contracts to import models or pin a published version. Desktop mocks also support gRPC responses and WebSocket message sequences.
Desktop mocks are free and answer calls made inside Echo. They do not open a network listener. A shared HTTP URL requires paid public hosting. To use rules inside your own .NET application or run an offline snapshot, see the packages guide.
Schedule a request
Save the request, open its schedule and choose its environment, cron expression and execution mode. Set the active state and review the next run shown by Echo. For example, */15 * * * * requests a run every fifteen minutes.
Desktop schedules need Echo and the machine to remain running. Hosted schedules continue on Gapfy's servers after you close the app and require a paid Echo plan and the relevant permission. Hosted execution accepts HTTP and GraphQL queries or mutations, with at least five minutes between runs. It does not accept gRPC, WebSocket, SSE or GraphQL subscriptions.
Wait for confirmation that a hosted schedule reached the server. A queued save or an ordinary sync is not that confirmation. Check the last result, failure message and timing baseline; adjust the regression threshold or reset the baseline when its reference is no longer useful. Maestro also shows hosted results and synced collection-run summaries.
Run from a terminal
The separate gapfy-echo CLI runs Echo-format folders without opening the desktop. It requires .NET 11 and access to its package on the Gapfy feed; it is separate from the stable echo-mock offline tool in the packages guide.
With the CLI installed, run a linked-folder export like this:
gapfy-echo run collection ./orders --env Development --data ./rows.csv --bail --junit ./results/run.xml --html ./results/run.html
Options include iterations, per-request timeout, proxy and verbose diagnostics. Server collection listing and download use --server and an application key with RunCollections; requests execute on the machine running the CLI, and results are not uploaded automatically.
Chains run from explicit chains/*.chain.json companion files with run chain and --chain. Linked-folder export does not create those chain files. Browser-based OAuth login is unavailable in the CLI. Exit codes are 0 for a completed run without failures, 1 for a request or assertion failure, 2 for usage, loading or report errors, and 130 for cancellation. Check executed counts too: an empty collection can finish without executing a request.
AI assists can draft assertions, suites and chain improvements for review.