BlazeMeter's Visual Studio Code Extension

BlazeMeter offers a Visual Studio Code extension to simplify local test creation and validation outside the BlazeMeter web interface. The extension provides a friendly user interface for test execution with the Taurus command line tool, helps you configure the BlazeMeter API connection, and manages test files. Through this extension, you can use VSC's built-in version control on local test scripts, test data, and configuration files, and you can sync local files with BlazeMeter.

What is Visual Studio Code?

Visual Studio Code (VSC) is a free lightweight code editor from Microsoft for building web, desktop, and mobile applications. It is a separate app from the paid MS Visual Studio.

How to install the BlazeMeter extension for VSC?

  1. Download the BlazeMeter extension from https://storage.googleapis.com/blazemeter/vsc/bzm-vscode-extension-0.0.1.vsix.

  2. Install the .vsix file by double-clicking the file and following the installer. For more information, see Install without using Extension Manager (microsoft.com).

  3. Install Taurus. For more information, see https://gettaurus.org/install/Installation/.

  4. Verify that you have the Taurus command line tool bzt installed.
    For more information, see https://gettaurus.org/docs/CommandLine/.

How to configure the BlazeMeter extension for VSC?

Configure the extension by providing your BlazeMeter API credentials and selecting the BlazeMeter project that you want to work with.

After installing the VSC extension, you see the BlazeMeter Settings page.

To enable VSC to log on to a.blazemeter.com:

In your browser:

  1. Log on to https://a.blazemeter.com/app/#/settings/api-keys.

  2. Click the Plus button to generate an API key. For more information, see BlazeMeter API keys.

    • Name it, for example, "VSC integration".

    • Define an expiry time.

  3. Copy the API key and API Secret and store them in a safe place.

Return to VSC.

  1. Paste the API key and API Secret into the BlazeMeter Extension Settings.
  2. After the credentials validate, continue defining the extension's Application Settings.
    • Select your BlazeMeter account.

    • Select your BlazeMeter workspace in that account.

    • Select your BlazeMeter project in that workspace.

  3. Close the Settings window.

You now see a BlazeMeter Explorer icon on the left side of the VSC interface.

How to use the BlazeMeter extension for VSC?

Open CSV code and open the local folder that contains your tests in the Explorer. Associate a local test with a BlazeMeter project and edit and validate the test locally. Sync the test and run it to generate the report in BlazeMeter.

The file named blazemeter.config.json in the directory with each local test contains its default settings. For more information, see The Test Object (BlazeMeter API docs).

To save a local test on the server

  1. Open a local test in VSC.

  2. Run the command "BlazeMeter: Create new test."
    The Command Palette bar prompts you for values.

  3. Type the response into the Command Palette bar and press Enter to confirm, or press Escape to cancel.

    • Enter Test Name...

  4. Wait for the extension to set up the new test on the server.

    A dialog opens and asks whether you want VSC to open an external website.

    • To open the test in the default browser, click Open.

    • To copy the URL to paste into another browser, click Copy.

    • To not open a browser window, click Cancel.

To associate a local test with a BlazeMeter project

To get BlazeMeter reporting, you need to associate the test with a project.

  1. Open a local test in VSC.

  2. Run the command "BlazeMeter: Set up BlazeMeter reporting."
    The Command Palette bar prompts you for values.

  3. Type each of the responses into the Command Palette bar and press Enter to confirm, or press Escape to cancel.

    • Enter Report Name...
      For example: My report

    • Enter Test Name...
      My test

    • Enter Project Name...
      Default

  4. The extension adds the blazemeter module to the YAML file.
    For example:

    modules:
      blazemeter:
        token: YOURAPIKEY:YOURSECRET
        address: https://a.blazemeter.com  # reporting service address
        data-address: https://data.blazemeter.com  # data service address
        browser-open: start  # auto-open the report in browser,
        # can be "start", "end", "both", "none"
        send-interval: 30s   # send data each n-th second
        report-times-multiplier: 1000  # multiplying factor for response times, advanced option
        timeout: 5s  # connect and request timeout for BlazeMeter API
        artifact-upload-size-limit: 5  # limit max size of file (in megabytes)
                                       # that goes into zip for artifact upload, 10 by default
        public-report: false  # set to true to create a public link to the report
        request-logging-limit: 10240 # use this to dump more of request/response data into logs, for debugging
    
        # following instructions will have effect when no per-reporter settings
        report-name: My report
        test: My test
        project: Default

To execute a local test

Verify you have the Taurus bzt tool installed. Associate local tests with a BlazeMeter project first before executing them.
  1. Open the local test in VSC.

  2. Run the command "BlazeMeter: Launch test locally."
    Taurus CLI runs the test and opens BlazeMeter in a browser window.

  3. The report appears in the BlazeMeter web UI under Reports > Recent test runs.

To update a local test

After you have made local changes, you want to upload the latest version of the test to BlazeMeter:

  1. Open a local test in VSC.

  2. Run the command "BlazeMeter: Sync local folder with test."

    The Command Palette bar prompts you for values.

  3. Select the response in the Command Palette bar and press Enter to confirm, or press Escape to cancel.

    • Select the target to which you want to sync files...

  4. Run the command "BlazeMeter: Open test link" to view the updated test in the BlazeMeter web UI.

The test and its dependencies are updated in the associated BlazeMeter project and in blazemeter.config.json.

To browse tests

  1. Click the BlazeMeter Explorer icon on the left side of VSC.

    The explorer has two collapsed sections, Performance tests and Functional tests.

  2. Expand the sections and type to filter tests by name.

  3. Select a test and click the action buttons to perform the following tasks:
    • Run the test

    • Open the test in the VSC editor

    • Open the test in the BlazeMeter web UI

To validate tests

  1. Browse to and open a test in VSC.

  2. In the bottom bar, click Validate BlazeMeter test.

  3. Review error messages in VSC.

Video demo

The following video quickly summarizes how to work with the VCS plugin.

Command Reference

In VSC, open the Command Palette and search for "BlazeMeter" to view a list of all integrated commands:

  • BlazeMeter: Sync local folder with test

  • BlazeMeter: Create a new test

  • BlazeMeter: Launch test locally

  • BlazeMeter: Open test link

  • BlazeMeter: Set up BlazeMeter reporting

  • BlazeMeter: Show Settings view