Skip to main content
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Hybrid load testing using Selenium Jest with JMeter or k6

Run a hybrid load test using Selenium with Jest scripts on BrowserStack Load Testing

Run a hybrid load test that combines your Selenium Jest browser tests with a JMeter or k6 protocol load test.

Supported versions

The following framework and engine versions are recommended for hybrid load tests with Selenium Jest:

Framework Node version Framework version Protocol engine
Selenium Jest Node.js 21 selenium-webdriver 4.25.0, Jest 29.7.0 JMeter 5.6.3, k6 2.0.0

Prerequisites

  • BrowserStack Username and Access key. You can find these under your account profile.
  • An existing JMeter script and an automated test suite written in Selenium with Jest (Node.js 18 or later).
  • A package.json file at the root of your Selenium Jest project that declares jest and a Selenium WebDriver package (for example, selenium-webdriver).

Before you zip and upload your Selenium Jest project, replace any local WebDriver instances with a RemoteWebDriver call so the tests run against the BrowserStack hub. For example, change new Builder().forBrowser('chrome').build() to new Builder().usingServer('http://localhost:4444/wd/hub').forBrowser('chrome').build().

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 Hybrid and click Upload scripts.

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

Upload your scripts

BrowserStack runs a hybrid test using JMeter and Selenium Jest automation projects. JMeter generates API-level load, and Selenium with Jest drives browser-level load to simulate real user interactions.

You see two sections:

  • JMeter Script: Upload your JMeter .jmx file (up to 50 MB). Drag and drop your file or click to select it.
  • Automation Project: Select Selenium - Jest from the dropdown as your automation framework. Then, upload your zipped project files (.zip up to 250 MB). Drag and drop the file or click to select it.

Load Sources step with JMeter selected as the API load source and Selenium - Jest selected as the browser automation project.

After you upload your ZIP file, the dashboard automatically validates your project. From the Select dependencies dropdown, select your package.json file so BrowserStack knows which dependencies to install for your tests.

Ensure that your package.json sits at the root level of your project and declares both jest and a Selenium WebDriver package (for example, selenium-webdriver).

Jest discovers tests by naming convention: files matching *.test.js, *.spec.js, or files inside a __tests__/ directory. You do not need to set a run target. To narrow the discovery set, use testMatch or testPathIgnorePatterns in your jest.config.js.

Both fields are mandatory for their respective test types. After uploading, click Configure Load to proceed to the next step.

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





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