Protocol load testing using k6
Run a protocol load test on BrowserStack Load Testing
Prerequisites
- BrowserStack Username and Access key. You can find these under your account profile.
- An existing k6 script.
Supported versions
BrowserStack runs your k6 load tests on the following engine version:
| Tool | Recommended version |
|---|---|
| k6 | 2.0.0 |
Run a test
You can start a new test either from the Quick Start page or the Load Tests page on the Load testing dashboard.
On the dashboard, click Create Load Test.

Enter a Test Name for your load test, select API Only, and click Upload scripts

Upload scripts
In this step, upload your k6 script.

Once you have verified the configuration, click Configure Load to move to the next step.
You can also run load tests using the sample scripts if you want to try out the feature before uploading your own files.
Use multi-file k6 scripts from the UI
You can upload a modular k6 test suite that uses multiple .js files and dependencies.
Upload scripts
- In the Script section of your load test configuration, choose one of the following:
- Upload a single
.jsfile. - Alternatively, you can also upload a
.zipfile that contains your main k6 script and any additional supporting files.
- Upload a single
- When you upload a
.zipfile:- Enter the main script path in the Main script field, relative to the root of the ZIP (for example,
tests/main.js). The platform uses this as the k6 entry point.
- Keep your folder hierarchy inside the ZIP. Relative imports such as
import { helper } from './utils/helper.js'continue to work because the directory structure is preserved during execution.
- Enter the main script path in the Main script field, relative to the root of the ZIP (for example,
Validation rules
- If you upload a ZIP and leave the Main script field empty, the test configuration shows an error and you cannot start the run until you specify an entry file.
- If the main script you specify does not exist inside the ZIP, the test configuration shows an error that the entry file cannot be found in the uploaded archive.
- The maximum supported ZIP size is 100 MB. If the archive exceeds this limit, the upload is rejected with a clear error message.
Use these checks to confirm the correct entry path before you run the test, so that all imports resolve successfully at runtime.
You can configure the following load parameters to customize your load test:
Run test
After you finish configuring load parameters, click RUN TEST .
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!