Setup Instructions

axemclion edited this page Nov 11, 2014 · 15 revisions

Getting Started

This page describes the various steps to get started with browser-perf. You can use browser-perf to test the following categories of browsers

  • Desktop browsers (Chrome, Safari, Firefox, IE) on your local machine
  • Mobile browsers on device or emulator
  • Cordova/Hybrid/WebView apps on emulator and real devices
  • Desktop browsers (Chrome, Safari, Firefox, IE) hosted on the cloud

Though tests are run using the command line, the Node API can also be used to run the tests.


The examples below record metrics when the page is scrolled. Other actions can also used when recording metrics and can be specified like this.

Testing Desktop Browsers locally

For testing any local browser, a selenium server is needed. Look at this section for more information about installing and running Selenium.


ChromeDriver needs to be downloaded from here. You can either start Chromedriver with selenium using java -jar selenium-server-standalone-2.40.0.jar or directly by opening the executable . Note that when started directly, the port and path of selenium would be different and the configuration file needs to reflect this.

To run browser-perf on a website using the command line. Note that the --selenium and --browsers options are not required since they are the default values.

$ browser-perf --selenium=http://localhost:4444/wd/hub --browsers=chrome

When only chromedriver is started,

$ browser-perf --selenium=http://localhost:9515 --browsers=chrome

Chrome - Canary Build

Like Chrome, it also needs Chromedriver and can be run in a similar way. The only difference is that it requires an additional configuration specifying where the canary executable resides. The best way to run this would be to specify the configuration in a file like this and then running

$ browser-perf --config-file=chrome_canary.config.json

Safari, Firefox

Safari and Firefox do not need any additional installs, the drivers are a part of the standard selenium server. The browser have to be specified to run the tests.

$ browser-perf --selenium=http://localhost:4444/wd/hub --browsers=safari
$ browser-perf --selenium=http://localhost:4444/wd/hub --browsers=firefox


Internet Explorer requires the IE driver to be downloaded(look for IEDriver zip files) and installed.

Testing Mobile Browsers

Chrome on Android

  1. Chrome on Android can tested using ChromeDriver directly.
  2. Ensure that adb executable is in the path. Then run
$ browser-perf --selenium=http://localhost:9515 --browsers=android

Older versions of the Android browsers are not supported. Chrome on emulator not tested, only tested with real device.

Safari on iOS

  1. Selenium is not required for this. Instead, install Appium using npm install -g appium and follow its setup instructions.
  2. Since additional configuration options are required, a config file may be used.
  3. Run appium and then browser-perf with the config file.

Testing Mobile Cordova (WebView/Hybrid) Applications

Android 4.4

  1. ChromeDriver needs to be installed and started.
  2. Since additional configuration is required, a config file like this can be used.
  3. The app must already be installed on the device.
  4. The emulator must be started, or the device must be connected.
  5. Note that the androidActivity and androidPackage need to be changed according to your app. No browser is specified.
  6. Run browser-perf with the config file.


  1. Install Appium using npm install -g appium and follow its setup instructions.
  2. Note that the bundleId and app must be change. app must point to an ipa or a zip file's absolute location.
  3. Run appium and start browser-perf with a config file like this.

Testing Browsers on the Cloud - Saucelabs or Browserstack

  1. Saucelabs and Browserstack provides hosted selenium. You would just need to connect to their servers. Note that if the site under test is not accessible over the internet, the tunnel module may need to be used.
  2. Set the selenium option for the command line or your node module to or
  3. Set the username and accesskey parameters to the corresponding user name and access key. This tool will automatically take care of adding the credentials either to the capabilities in case of browserstack or to the selenium url in case of saucelabs.

Installing and running Selenium

  1. Ensure that you have java installed
  2. Download Selenium Selenium Server (formerly the Selenium RC Server)
  3. Start the selenium server locally using java -jar selenium-server-standalone-2.40.0.jar Don't forget to correct the filename of the jar and Chrome driver file
  4. Wait till you see the logs that say Selenium has started. You can then start browser-perf tests.

Alternatively if you have brew, run brew install selenium-server-standalone. You can run it with selenium-server.