Skip to main content
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Protocol load testing using k6

Run a protocol load test on BrowserStack Load Testing

Prerequisites

  • BrowserStack Username and Access key. You can find this under your account profile.
  • An existing k6 script.

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.

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

In this step, upload your k6 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.

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 max 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 .js file.

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