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.
Enter a Test Name for your load test, select Hybrid and click Upload scripts.
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.
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:
The Load Testing CLI is bundled with the BrowserStack Node.js SDK. If you have already installed the SDK, you can skip this step.
Initialize your project for Load Testing
Run the following command from the root directory of your Selenium Jest test project to generate the browserstack-load.yml file, which contains the configuration required to define and run your hybrid load test:
Refer to the given table to use the framework and language combination argument:
Framework
Argument
Selenium Jest + JMeter
--framework jest jmeter --language nodejs
Configure your load test
Open the generated browserstack-load.yml file and update it with the relevant Selenium Jest and JMeter test details. Use it to define your virtual users, duration, load profile, and regions.
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 100. Contact us if you want to increase this limit.
Before running a full-scale load test, do a sanity check with a small set of virtual users to validate your configuration and test stability.
Specify the tests
The tests block defines the combination of test types you want to run as part of a hybrid load test. Specify Selenium as the testType for one sub-block and JMeter for another.
For the Selenium sub-block:
browserLoadPercent: Specify the percentage of total virtual users to allocate to the Selenium tests.
language: Set this to nodejs.
framework: Set this to jest.
files: Define the key files needed to install dependencies.
Under dependencies, add the path to your package.json file. BrowserStack uses this file to run npm install before invoking Jest.
You do not need to specify a runTarget. Jest auto-discovers tests using its naming convention (*.test.js, *.spec.js, or files inside a __tests__/ directory). To narrow the test set, configure testMatch or testPathIgnorePatterns in your jest.config.js file.
For the JMeter sub-block:
apiLoadPercent: Specify the percentage of total virtual users to allocate to the JMeter tests.
testScripts: Set the path to the .jmx file.
Do not include the node_modules directory in your ZIP. BrowserStack runs npm install from your package.json before invoking npx jest, so any pre-bundled node_modules is redundant and counts against the 250 MB upload limit.
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 to Z, a to z)
Digits (0 to 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:
Before running a full-scale hybrid load test, do a sanity check with a small set of virtual users to validate your Selenium Jest configuration, JMeter or k6 setup, and test stability.
BrowserStack Username and Access key. You can find these under your account profile.
An existing k6 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.
Enter a Test Name for your load test, select Hybrid and click Upload scripts.
Upload your scripts
BrowserStack runs a hybrid test using k6 and Selenium Jest automation projects. k6 generates API-level load, and Selenium with Jest drives browser-level load to simulate real user interactions.
You see two sections:
k6 Script: Upload your k6 .js 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.
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:
The Load Testing CLI is bundled with the BrowserStack Node.js SDK. If you have already installed the SDK, you can skip this step.
Initialize your project for Load Testing
Run the following command from the root directory of your Selenium Jest test project to generate the browserstack-load.yml file, which contains the configuration required to define and run your hybrid load test:
Refer to the given table to use the framework and language combination argument:
Framework
Argument
Selenium Jest + k6
--framework jest k6 --language nodejs
Configure your load test
Open the generated browserstack-load.yml file and update it with the relevant Selenium Jest and k6 test details. Use it to define your virtual users, duration, load profile, and regions.
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 100. Contact us if you want to increase this limit.
Before running a full-scale load test, do a sanity check with a small set of virtual users to validate your configuration and test stability.
Specify the tests
The tests block defines the combination of test types you want to run as part of a hybrid load test. Specify Selenium as the testType for one sub-block and k6 for another.
For the Selenium sub-block:
browserLoadPercent: Specify the percentage of total virtual users to allocate to the Selenium tests.
language: Set this to nodejs.
framework: Set this to jest.
files: Define the key files needed to install dependencies.
Under dependencies, add the path to your package.json file. BrowserStack uses this file to run npm install before invoking Jest.
You do not need to specify a runTarget. Jest auto-discovers tests using its naming convention (*.test.js, *.spec.js, or files inside a __tests__/ directory). To narrow the test set, configure testMatch or testPathIgnorePatterns in your jest.config.js file.
For the k6 sub-block:
apiLoadPercent: Specify the percentage of total virtual users to allocate to the k6 tests.
testScripts: Set the path to the .js file.
Do not include the node_modules directory in your ZIP. BrowserStack runs npm install from your package.json before invoking npx jest, so any pre-bundled node_modules is redundant and counts against the 250 MB upload limit.
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 to Z, a to z)
Digits (0 to 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:
Before running a full-scale hybrid load test, do a sanity check with a small set of virtual users to validate your Selenium Jest configuration, JMeter or k6 setup, and test stability.