node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป


RedLine13 Peformance Testing with WebDriver

Runs WebDriver test to collect performance data and exports Apache JMeter data (as a .jtl)

  • PhantomJS - supports exporting performance data in realtime
  • Chrome - supports exporting performance data at end of test, realtime metrics available using Performance APIs
  • Chrome Headless - supports exporting performance data at end of test, realtime metrics available using Performance APIs
  • Firefox - performance data is extraced realtime using Performance APIs
  • Firefox Headless - performance data is extraced realtime using Performance APIs
  • IE - not supported
  • Safari - not supported


npm install redline13-webdriver

integrating with your tests

In your webdriver test file

  // include redline
  var redline = require( 'redline13-webdriver' );

  // load your driver via redline13
  // redline13 library uses standard mechanism but presets some capabilities
  var browser = redline.loadBrowser('chrome');

  // You can require webdriver yourself or use redline13.webdriver
  var By = redline.webdriver.By;
  var until = redline.webdriver.until;

  browser.get( "" );

Tracking your API Performance in browser for Firefox

While PhantomJS emits realtime performance events, and Chrome provides logging for performance data, Firefox does not. However by using Web Performance APIs we can now track and report back some performance information.

For firefox and firefox-headless this module will override get to automatically capture performance data in realtime.

To add for chrome, chrome-Headless, and collect more data in firefox you can add the following to your code

  browser.get( "" );
  browser.recordrecordMetrics( "example" );

Running at Scale on RedLine13

Checkout out and you can easily run this as 5 users or 5000 users. We have example of running a 5000 user selenium-webdriver performance test for $10.

redline13 methods

redline.loadBrowser( string browser, string domains, boolean hardFilter )

loads selenium driver class while wrapping to capture performance data

  @param browser phantomjs | chrome | firefox
  @param domains string space separated list of domains(regex) filters for inclusion in performance data
  @param hardFilter boolean true will cause anything not filtered to be ignored, false anything not filtered will be recorded only by domain name.

  @return Driver instance

redline.snap ( string filename )

Captures a screenshot and tracks completion. During a test on if you capture a screenshot and store it to output/filename.png it will make that screenshot available after test completion. This functions calls the normal takeScreenshot but forces storing filename in output/filename.

redline13 properties

api provides access to the redline13 api for recording extra performance or error data.

Locally it provides two methods

  • api.recordError( string|object error )
  • api.record(string label, date timestamp, int elapsed time, boolean err, int kb)

driver the driver loaded for the selected browser type webdriver - the original resource from require ('selenium-webdriver')

user name or id of user running test, will default to 0. During load tests this will be unique for each user simulated.

config empty by default. During a load test will provide data used to configure test definition.