- Docs
- Reference
- Step reference
- Load test steps: JMeter and k6
Load test steps: JMeter and k6
A load-test step runs a JMeter test plan or a k6 script against your system. You can upload one you already have, or let AI build it from the API steps you recorded. A load test lives in a test case of its own.
In short
On this page you can
- Upload an existing JMeter
.jmxfile or k6.jsscript as a step. - Generate a test plan or script with AI from the API steps of a test case.
- Read and edit the plan in a Code view and a Design view.
- Refine the plan with a prompt, for example to add think time.
- See failed requests, error rate and the report of each run.
How to use it
- Build a test case with the API steps to load-test, and save it.
- Click More › JMeter or k6.
- Choose Upload JMX / Upload script, or Generate JMX / Generate k6 script.
- For AI: describe users, ramp-up and checks, review the plan, then Generate and save as a new test case.
- Run it in a pipeline with load settings; a Dry Run uses the script’s own defaults.
At a glance
- Added from
- More › Load test › JMeter or k6. Chips: JMeter, k6.
- Project types
- WEB and DESKTOP. Not in mobile projects.
- Combines with
- Only JMeter, k6 and API steps in the same test case.
- Runs on
- The machine that runs the test. JMeter must be installed there; k6 is downloaded automatically when missing.
- Passes when
- No request failed (and, for k6, the script’s thresholds hold).
- Time limit
- Set by the platform administrator; 1 hour unless changed.
A load test needs its own test case#
A test case with a JMeter or k6 step takes only JMeter, k6 and API steps (see Load-test scenarios). A test case with browser, mobile or desktop steps takes no load-test step.
- In a load-test case, the toolbar shows only API and More, with the note “This scenario is a load test: only JMeter, k6 and API steps can be added.”
- In a case with other steps, JMeter and k6 are disabled: “This scenario has browser steps. JMeter goes only with API steps; put the load test in a scenario of its own.”
Upload a file#
Open the choice
Click More › JMeter (dialog Add JMeter Performance Test) or k6 (dialog Add k6 Load Test).
Upload
Choose Upload JMX (“Upload an existing .jmx file”) or Upload script (“Upload a ready k6 .js script”) and pick the file.
The file becomes one step. A k6 file must contain
export default function; otherwise: “This file is not a k6 script (no "export default function").”Save
Click Save.
Generate with AI from API steps#
AI builds the plan from the API steps of the current test case, in their order, including the values they save and reuse (for example a login token used by the next requests).
Prepare the API steps
Add and save the API steps of the journey to load-test. Without them the dialog shows “No API requests to test yet”.
Open Generate
Click More › JMeter › Generate JMX, or k6 › Generate k6 script. The dialog shows how many API requests it will use.
Describe the load
Write what you want, for example: “100 users, 30s ramp-up, repeat each request 5 times, 1s think-time between requests, add an assertion for HTTP 200.” A prompt is required (“Please enter a prompt.”).
Review the plan
The dialog prepares a plan in words (Test plan (you can edit it)). Edit it or click Regenerate plan. Then click Generate.
Check and refine
The result opens with a Code tab and a Design tab. Use Refine with prompt for changes; the AI’s changes are highlighted and can be undone.
Save as a new test case
Click Save as JMeter or Save as k6 test.
A new test case named after the source with “ - JMeter” or “ - k6” is created in the same folder, with the load-test step in it. The source case stays as it is.
View and edit the plan#
Select the load-test step to see its file in the right panel.
- JMeter: JMX (XML) with Edit, Edit with AI (“Fix or extend with a prompt (current JMX is kept)”) and Download .jmx. The Design tab shows the Test Plan (Design). An edit that is not a valid test plan is refused: “Not a valid JMX (jmeterTestPlan); the change was not applied.”
- k6: k6 script (JavaScript) with edit, refine and Download .js. The design shows the scenario (users, ramp-up, duration, iterations, think time) and each request with its method, URL, checks and extracted variables.
- Applied changes are kept only after you save: “JMX updated. Save the test case to keep it.”
At run time#
- Load settings. In a pipeline, the pipeline’s load settings in Schedule (users, ramp-up, duration, loops, think time) are passed to the plan. A k6 script uses them only if it reads them; the design shows “This script does not read run parameters (__ENV); its load settings are fixed in the script.” otherwise.
- Dry Run. No pipeline settings exist: JMeter uses the values in the JMX; k6 runs with 1 user and 1 iteration.
- Pass or fail. One failed request is enough to fail the step: “12 of 480 requests failed (2.5%). Top error: …”. For k6, failed script thresholds fail it too (“k6 thresholds of the script failed (exit code 99).”). The report stores a failed load step as ERROR.
- Limits. The platform administrator sets a time limit (1 hour unless changed) and a maximum number of users. A plan above the user limit does not start. A test that hits the time limit is stopped and reports its partial results.
- Stopping. Stopping a pipeline run stops the load test; completed requests are still reported.
- Results. JMeter writes an HTML report. A k6 step offers Download results (the raw samples as a JTL-format CSV). Live numbers appear on the report while the test runs.
rate (%) = failed requests ÷ total requests × 100 (rounded to one decimal) step = FAILED when failed requests > 0
Example: 480 requests, 12 failed. 12 ÷ 480 × 100 = 2.5 %. The step fails, because at least one request failed, and the message names the most frequent error.
If something goes wrong#
Didn’t find your answer?Write to support with your project name and what you see on screen.
info@smartestqa.ai