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

Bamboo CI/CD with BrowserStack Load Testing

Integrate BrowserStack Load Testing into Atlassian Bamboo plans to run load tests in your self-hosted CI/CD workflows.

You can add BrowserStack Load Testing to your Bamboo plans so that every plan execution triggers a load test. This integration works with Bamboo Server and Bamboo Data Center deployments.

Prerequisites

Make sure you have the following before you start:

  • A BrowserStack account with access to Load Testing.
  • A self-hosted Bamboo Server or Bamboo Data Center installation with at least one active build agent (local or remote).
  • Bamboo plan or global variables for your BrowserStack credentials. You can find the credentials on your account’s profile page:
    • BROWSERSTACK_USERNAME: Your BrowserStack username.
    • BROWSERSTACK_ACCESS_KEY: Your BrowserStack access key.

To add the variables:

  1. Sign in to your Bamboo instance as an admin.
  2. In the top navigation, click the gear icon → Global variables (for shared credentials) or open your plan and go to Plan configuration → Variables (for plan-scoped credentials).
  3. Click Add variable:
    • Key: BROWSERSTACK_USERNAME, Value: your BrowserStack username.
    • Key: BROWSERSTACK_ACCESS_KEY_password, Value: your BrowserStack access key. The _password suffix tells Bamboo to mask the value in logs.
  4. Save.

Bamboo exposes plan and global variables to scripts as ${bamboo.<KEY>} placeholders or as bamboo_<KEY> environment variables.

Bamboo plan configuration

Use the following Bamboo Specs YAML to define the plan as code. Save it under bamboo-specs/bamboo.yaml in a Git repository linked to your Bamboo instance, or replicate the same task structure manually via the Bamboo UI.

---
version: 2
plan:
  project-key: LT
  key: LOAD
  name: BrowserStack Load Test

stages:
  - Load Test:
      jobs:
        - Load Test

Load Test:
  tasks:
    - checkout:
        force-clean-build: true
    - script:
        interpreter: SHELL
        scripts:
          - |
            echo "Running unit tests"
    - script:
        interpreter: SHELL
        scripts:
          - |
            OS=$(uname -s); ARCH=$(uname -m)
            [ "$OS" = "Darwin" ] && OS=macos || OS=linux
            case "$ARCH" in *arm*) ARCH=arm64 ;; *) ARCH=x64 ;; esac
            curl -fL "https://load-api.browserstack.com/api/v1/binary?os=${OS}&arch=${ARCH}" -o browserstack-cli.zip
            unzip -oq browserstack-cli.zip
            chmod +x browserstack-cli
    - script:
        interpreter: SHELL
        scripts:
          - |
            curl -L https://github.com/browserstack/browserstack-playwright-load-testing-sample/archive/refs/heads/CI/CD-Sample-Playwright.tar.gz \
              | tar -xz --strip-components=1
    - script:
        interpreter: SHELL
        environment: "BROWSERSTACK_USERNAME=${bamboo.BROWSERSTACK_USERNAME} BROWSERSTACK_ACCESS_KEY=${bamboo.BROWSERSTACK_ACCESS_KEY_password}"
        scripts:
          - |
            ./browserstack-cli load run
  artifacts:
    - name: load-test-report
      pattern: 'reports-*/browserstack-load-test-report-*.xml'
      shared: true
      required: false
  requirements:
    - system.builder.shell.Bash

variables:
  BROWSERSTACK_USERNAME: ""

triggers:
  - polling:
      period: 180

branches:
  create: manually
  delete: never
  link-to-jira: true

notifications: []
labels: []
other:
  concurrent-build-plugin: system-default
---
version: 2
plan:
  key: LT-LOAD
plan-permissions:
  - users:
      - admin
    permissions:
      - view
      - edit
      - build
      - clone
      - admin

Result

When this plan runs, it:

  • Downloads the BrowserStack CLI for the current agent OS and architecture.
  • Fetches the BrowserStack Playwright load-testing sample project.
  • Starts a BrowserStack Load Testing run using your BrowserStack credentials, sourced from the plan and global variables.
  • Publishes the generated JUnit XML reports as a shared plan artifact.

Notes

  • Bamboo Server and Bamboo Data Center are licensed software. Atlassian provides a 30-day evaluation license for new installations.
  • The _password suffix on BROWSERSTACK_ACCESS_KEY_password is a Bamboo convention that masks the value in build logs. Without the suffix, Bamboo prints the access key in plain text.
  • The script task explicitly threads ${bamboo.BROWSERSTACK_USERNAME} and ${bamboo.BROWSERSTACK_ACCESS_KEY_password} into the environment for the ./browserstack-cli load run step. This is required because Bamboo exposes plan variables as bamboo_<KEY> environment variables (with prefix), but the BrowserStack CLI looks for BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY (without prefix).
  • For UI-driven plan creation (instead of YAML Specs), replicate the four script tasks as Script task entries in the plan’s job configuration.

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