Skip to main content
No Result Found
Connect and get help from 7,000+ developers on our Discord community. Ask the CommunityAsk the Community

Protocol load testing using JMeter

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 JMeter script.

Run a test

Based on your preferred method of performing load tests, use one of the following methods:

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.

Screenshot of load testing dashboard showing the run a new test button highlighted

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

Dashboard showing test name field and type of load test to run

Upload scripts

Upload your JMeter script.

Screenshot of load testing dashboard asking to add scripts for load testing

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 JMeter scripts from the UI

You can upload a modular JMeter test suite that uses multiple .jmx files and dependencies.

Upload scripts
  • In the Script section of your load test configuration, choose one of the following:
    • Upload a single .jmx file.
    • Alternatively, you can also upload a .zip file that contains your main JMeter script and any additional supporting files.
  • When you upload a .zip file:
    • Enter the main script path in the Main script field, relative to the root of the ZIP (for example, tests/main.jmx). The platform uses this as the JMeter entry point. Screenshot of uploaded JMeter scripts in the load testing UI builder
    • Keep your folder hierarchy inside the ZIP. Relative imports such as import { helper } from './utils/helper.jmx' continue to work because the directory structure is preserved during execution.
Validation rules
  • If you upload a ZIP file 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 file, 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 .

Download the BrowserStack Load Testing CLI

Download the CLI based on your operating system:

Generate the YAML file

Run the given command to generate the browserstack-load.yml file which contains the configuration required to define and run your load test:

Copy icon Copy

Configure your Load Test

Open the generated browserstack-load.yml file and update it with the relevant test details. Here’s a sample configuration:

Specify number of virtual users

Set vus to the maximum number of virtual users to simulate during the test. The maximum limit for this config is currently 1000. Contact us if you want to increase this limit.

Specify the test scripts

The files block defines the key files needed to identify which tests to execute.

  • testScripts: Set the path to the .jmx file.
Use multi-file JMeter scripts with the CLI

You can run multi-file JMeter tests from the CLI by configuring your test directory and entry script in browserstack-load.yml.

Update the files block

Add testDir and testScripts under the files section of your configuration.

  • testDir: Absolute path to the directory that contains all your JMeter scripts and helper files. The directory is zipped and uploaded as-is, so your folder structure is preserved.
  • testScripts: Absolute path to the main JMeter entry script, relative to testDir.
Behavior and constraints
  • The CLI validates that the entry script defined in testScripts exists inside testDir. If it is missing, the run fails fast with an error.
  • All files and folders inside testDir are included in the upload. Relative imports between files work as long as the referenced files live under this directory.
  • If your test imports a file that is not present under testDir, the test run fails when JMeter executes those imports.
  • Very large directories increase upload time. Keep the contents of testDir limited to only the scripts and dependencies required for the test run.

Set reporting structure

  • Use projectName to group related tests under the same project on the dashboard. Use testName to group multiple runs of the same test.
  • Both projectName and testName must remain consistent across different runs of the same test.
  • You can use the following characters in projectName and testName:
    • Letters (A–Z, a–z)
    • Digits (0–9)
    • Periods (.), colons (:), hyphens (-), square brackets ([]), forward slashes (/), at signs (@), ampersands (&), single quotes (‘), and underscores (_)
    • All other characters are ignored.

You can configure the following load parameters to customize your load test:

browserstack-load.yml

Run the Load Test

Run the given command to start your test:

Copy icon Copy

Check out the FAQs section to get answers to commonly asked questions.

View test results

Once the test starts running, you’ll get a link to the test report. You can also view your test results in the Load Testing dashboard.

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle