Skip to content

About

Sample repository for WebdriverIO load-testing test

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

browserstack-webdriverio-load-testing-sample

This repo contains samples for running WebdriverIO tests on BrowserStack using the browserstack-node-sdk.

BrowserStack Logo

Setup

  • Clone the repo git clone https://github.com/browserstack/browserstack-webdriverio-load-testing-sample.git.
  • Set your credentials as environment variables, as described in Set your credentials.
  • Run npm i to install the dependencies.
  • Open browserstack-load.yml and update it with the relevant load test configurations. Leave userName and accessKey as they are.

Set your credentials

The BrowserStack CLI reads your credentials from environment variables. Copy your username and access key from Account Settings and export them in the shell you run the test from:

On macOS or Linux (bash or zsh), run the lines below. The second one prompts for the key without echoing it, so the key stays out of your shell history:

export BROWSERSTACK_USERNAME="<your-username>"
printf 'BrowserStack access key: '; read -rs BROWSERSTACK_ACCESS_KEY; echo; export BROWSERSTACK_ACCESS_KEY

On Windows, run these in PowerShell. The second line prompts for the key in the same way:

$env:BROWSERSTACK_USERNAME = "<your-username>"
$env:BROWSERSTACK_ACCESS_KEY = [System.Net.NetworkCredential]::new('', (Read-Host -AsSecureString 'BrowserStack access key')).Password

These variables last only for the current terminal session. If the CLI reports an authentication error, check that both are set in the terminal you run it from.

Never commit your credentials. Leave the userName and accessKey placeholders in browserstack-load.yml as they are (the environment variables override them), and keep your access key out of every file you push. If a key is ever exposed, regenerate it from Account Settings.

Running your tests

  • Run the given command to start your test: npx browserstack-cli load run.

Notes

About

Sample repository for WebdriverIO load-testing test

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages