k6 Browser Testing

k6 is an open-source tool designed to do easy load testing against websites. With the k6 browser module, you can connect to a CDP-compatible browser grid such as TestingBot. Simply configure your k6 test to use the TestingBot grid, and instantly get access to a high capacity cloud of browsers.

With this integration, you can run tests in parallel, targetting different browsers, versions and operating systems. Each test comes with logs, screenshots and a video.


To get started, please make sure you install k6.


brew install k6


winget install k6 --source winget


sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6


Next, let's run a sample browser test using k6 on the TestingBot browser grid. Please see the example below.

To connect to the TestingBot CDP grid, you will need to specify a K6_BROWSER_WS_URL environment variable. This needs to contain the URL to the TestingBot grid, together with the credentials and (url-encoded) capabilities.


To run the example below, you can use the following command in your terminal:

K6_BROWSER_WS_URL="wss://cloud.testingbot.com/?key=...&secret=...&capabilities=%7B%22browserName%22%3A%22chrome%22%2C%22browserVersion%22%3A%22latest%22%7D" K6_BROWSER_ENABLED=true k6 run k6_sample.js
import { browser } from 'k6/experimental/browser';
import { check } from 'k6';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
  thresholds: {
    checks: ['rate==1.0'],

export default async function () {
  const context = browser.newContext();
  const page = context.newPage();

  try {
    await page.goto('https://test.k6.io/my_messages.php');


    const submitButton = page.locator('input[type="submit"]');

    await Promise.all([page.waitForNavigation(), submitButton.click()]);

    check(page, {
      header: (p) => p.locator('h2').textContent() == 'Welcome, admin!',
  } finally {


To construct the K6_BROWSER_WS_URL, you'll need to urlencode the capabilities:

const capabilities = {
	browserName: 'chrome',
	browserVersion: 'latest',
	platform: 'VENTURA'

Test Results

You can find the results of your k6 browser test in your terminal.

The TestingBot member area will contain a list of all k6 tests, together with logs, screenshots and a video of each test.