node package manager


Add remote workers from the BrowserStack web service to the TestCafe.

Add remote workers from the BrowserStack web service to the TestCafe

This module allows to enrich the TestCafe browsers list by adding remote workers from the BrowserStack web site that provides a large list of browsers for testing.

The module contains a set of functions that help to initialise, create and remove a remote worker.

npm install testcafe-browserstack

Module initialization

  • config: Configuration that is required for the module initialization

    • TestCafe: TestCafe Configuration
      • hostname: The hostname of your computer
      • controlPanelPort: The port number where you can access TestCafe Control Panel
      • servicePort1: The number of the first port used to perform testing
      • servicePort2: The number of the second port used to perform testing
    • BrowserStack: BrowserStack Configuration
      • username: Your BrowserStack username
      • password: Your BrowserStack password
      • accessKey: Your BrowserStack access key
      • localTesting: true if your TestCafe is installed in the local PC, otherwise false
  • callback( function() ): Invokes when the initialization is completed

Creates new BrowserStack workers and returns an array of workers ids.

  • browsers: An array of browsers objects from the BrowserStack service
    • browserObject
      • os: The operation system
      • os_version: The operation system version
      • browser: The browser name
      • browser_version: The browser version
      • device: The device name
      • worker_name: The worker name that will be used by TestCafe to identify the browser for test execution
  • callback( function( workerIds ) ): Invoked when workers are created
    • workerIds: An array of workers id

Delete the specified BrowserStack workers.

  • workerIds: An array of workers id
  • callback( function() ): Invokes when the specified workers are deleted

Delete all BrowserStack workers.

  • callback( function() ): Invokes when all workers are deleted


This example demonstrates how to create a new worker for running tests in Chrome with the OS X Snow Leopard operating system. The worker is created in a local TestCafe instance.

var testCafeBrowserStack = require('testcafe-browserstack');

	TestCafe: {
		hostname: '',
		controlPanelPort: 1337,
		servicePort1: 1338,
		servicePort2: 1339
	BrowserStack: {
		username: 'username',
		password: 'password',
		accessKey: 'accessKey',
		localTesting: true
}, function() {
		os: 'OS X',
		os_version: 'Snow Leopard',
		browser: 'chrome',
		browser_version: '40.0',
		device: null
	}], function(e) {
		console.log('All workers are created!')

Check if a required browser is supported by BrowserStack: a list of supported browsers.