Build scenarios
Advanced HTTP: parallel requests, cookies, downloads, XML and JSON filters
Parallel requests, cookies, downloads and sizes, XML with XPath, JSON filters.
Real pages load several resources at once, set cookies, download files and talk XML as well as JSON. This page shows how to reproduce all of that in the workflow editor, without code.
Send requests at the same time
A browser loads a page's data in parallel. To do the same, add Parallel requests (palette Requests) and put HTTP or GraphQL requests inside it, 2 to 50 of them.

- The requests are sent together, and the step ends when every response has arrived.
- Each request keeps its own checks, extractions and what to do when a check fails. They run in the order of the requests, once every response is in.
- A request in the container cannot use a value that another request of the same container extracts: all the requests are prepared before any is sent. The values are ready after the container.
- A request in the container cannot be retried.
- The test configuration limits how many requests are sent at once in total (20 by default) and per host (6 by default, like a browser).
When you analyze a browser recording, requests that overlapped in time and do not depend on one another become one
parallel container. A HAR file imported through the API, the CLI or the assistant does the same when its Parallel
option is on (off by default).
Cookies
Every virtual user has its own cookie jar: the cookies the site sets are sent back automatically. Two tools change it.
- Cookies step (palette Data): set a cookie (name, value, and optionally domain, path, lifetime, secure, HTTP only), delete a cookie by name or clear all the cookies of a site. The step acts on the site of the scenario's base URL unless you give another URL. The value cannot be a secret: a later extraction could copy it.
- Cookies of a request (in the Options section of an HTTP or GraphQL request): cookies sent with this request only, never kept in the jar. Their value can be a secret, as in a header. Tick Replace the kept cookie to send your value instead of the jar's cookie of the same name.
A JMeter Cookie Manager becomes Cookies steps at the start of each flow.
Downloads and body sizes
- Tick Download as binary data on a request that downloads a file (PDF, image, archive): the response is kept as bytes, not text. Text checks and extractions on its body are then refused.
- The Response size (bytes) check compares the size of the response body: greater than 10000 checks that a report was really generated.
- Compress the body compresses the body you send (gzip, deflate, br or zstd) and says so in
Content-Encoding. - Very large numbers are sent as you wrote them. An id such as
9007199254740993(beyond what a JavaScript number holds exactly) or a decimal with many digits keeps all its digits in a JSON body, GraphQL variables, a gRPC message, a URL, a header or a form field, whether you typed it, put it in a variable or read it from a data set. Only a comparison (a check such as equals 9007199254740993, a condition) uses the nearest number JavaScript can hold: the editor then shows the advice "… is compared as a JavaScript number" and how to compare text instead.
Choose the match you keep
Extractions from JSON, a regular expression, HTML, boundaries or XPath can find several values. Which match says which one to keep: the first (the default, except for JSON), the last, a random one, the n-th, or all of them as a list (an empty list when nothing matches, then the default value applies). For JSON, the default is As the path selects it: one value, or the list of the values when the path can select several. A random match spreads the load over several products, for example.
Keep a part of a header, a cookie or the final URL
Some applications return the id of what you just created only in a header: the answer to "create an order" is
201 Created with Location: /api/orders/8f14e45f-ceea-467f-a8d6-0c1f2d3e4b5a and nothing in the body. The next
requests need that id, not the whole header.
- On the request that creates the order, add an extraction with the source Header and the name
Location. - In Part to keep, type a regular expression whose parentheses surround what you want:
/orders/([^/?#]+)keeps what follows/orders/up to the next/,?or#. It reads/api/orders/8f14…,https://shop.example/api/orders/8f14…/and/api/orders/8f14…?created=1alike. - Give the variable a name (
orderId) and use{{orderId}}in the next requests: in the URL (/api/orders/{{orderId}}), a query parameter or the body.
Leave Part to keep empty to keep the whole value, as before. Once a pattern is typed, two more fields appear:
Flags (i ignores case) and Group (which pair of parentheses to keep when the pattern has several; 0 keeps
everything the pattern matched). The same field exists for the Cookie and Final URL sources: after a redirect
that the request follows, the Location header is gone, so read the id from the final URL instead.
When the header is absent or the pattern finds nothing, nothing is extracted: the default value applies, and a Required extraction fails its check, so the run tells you at that step rather than three requests later.
A recording or a HAR import does this for you: when a later request sends an id that an earlier answer returned only in
Location, the scenario gets this extraction and the variable. If you see the notice "This request sends an id that
an earlier response returned in its Location header…", the id is still replayed as recorded (it was written
percent-encoded in the header, or you rejected the correlation): add the extraction by hand as above.
XML and SOAP: XPath
For an XML response, extract with the XML (XPath) source and check with the XML value (XPath) check.

//order/@statusgives the status attribute;count(//line)gives the number of lines;//product[priceCents > 1000]/namegives the names of the products above 10.00.- Ignore namespaces (on for a new XPath extraction) matches names whatever their namespace: the simple choice for
SOAP. To be strict, turn it off and add a namespace row per prefix you use (
o=urn:swarmetry:orders, then//o:order). - An XPath check can test that something exists (
exists) or compare its value. - Supported: XPath 1.0 paths with
//,.,..,@,*,text(), predicates ([1],[last()],[@id='7'],and,or,not()) and the common functions (count,contains,starts-with,normalize-space,string,concat,substring-before,substring-after,local-name,name…). Anything else (other axes, unions, arithmetic) is reported as a problem on the step before the test runs. - For safety, the document type declarations of an XML document (DTD) and the entities they define are never processed, and a malformed document gives "nothing found".
JMeter XPath extractors and assertions are imported as XPath extractions and checks. JMeter keeps its namespace prefixes in a separate file, so imported prefixed paths use Ignore namespaces; a warning says so.
JSON filters
JSON extractions and checks accept JSONPath, the standard way to point at values in a JSON answer (RFC 9535):
| Path | Gives |
|---|---|
$.items[0].id |
the id of the first item |
$.items[-1].id |
the id of the last item |
$..id |
every id, at any depth |
$.items[0:3] |
the first three items |
$.items[?@.stock > 0].id |
the ids of the items in stock |
$.items[?@.category == 'books' && @.price < 20] |
the books under 20 |
$.items[?match(@.sku, 'A-[0-9]+')] |
the items whose reference (sku) is A- followed by digits |
$.items[?length(@.tags) > 1] |
the items with more than one tag |
A path that may give several values gives a list unless you choose Which match; when a filter or .. finds
nothing, the path gives nothing (a required extraction fails, its default applies). In a check, exists tells whether
it finds anything and contains whether one of the values is the one you give. Syntax from other tools (=~,
in, size, .length()) is refused with the position of the mistake: write it with the functions above.
Ask the assistant
The assistant knows worked examples of parallel requests, cookies, downloads, XPath, JSON filters and match selection. Ask it, for example: “in Shop session, open a random product of the list” or “read the name of product p-002 from the XML catalog”.