JSPM

  • Created
  • Published
  • Downloads 143388
  • Score
    100M100P100Q199366F
  • License MIT

installs a `start-selenium` command line to start a standalone selenium server with chrome-driver

Package Exports

  • selenium-standalone

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (selenium-standalone) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

selenium-standalone

Build Status Dependency Status devDependency Status

Command line or programmatic install and launch of latest selenium standalone server, chrome driver and internet explorer driver.

It will install a start-selenium command line that will be able to launch firefox, chrome, internet explorer or phantomjs for your tests.

npm install selenium-standalone@latest -g
start-selenium

Any arguments passed to start-selenium are then passed to java -jar ...jar args.

So you can start-selenium -debug to launch standalone selenium server in debug mode.

Selenium version

Currently installs selenium 2.44.0, chrome driver 2.13 and internet explorer driver 2.44.0 by default. You can override the versions installed by defining SELENIUM_VERSION, CHROMEDRIVER_VERSION or IEDRIVER_VERSION env variables before npm installing

SELENIUM_VERSION=2.42.0 npm install selenium-standalone@latest -g
start-selenium

Running headlessly

On linux,

To run headlessly, you can use xvfb:

xvfb-run --server-args="-screen 0, 1366x768x24" start-selenium

Available browsers

By default, google chrome, firefox and phantomjs are available if installed on the sytem.

Example: launch www.google.com

Using a selenium driver like wd:

npm install wd -g
wd shell
(wd): browser = wd.remote(); browser.init(function(){browser.get('http://www.google.com')})

Programmatic use

var selenium = require('selenium-standalone');

var spawnOptions = { stdio: 'pipe' };

// options to pass to `java -jar selenium-server-standalone-X.XX.X.jar`
var seleniumArgs = [
  '-debug'
];

selenium(spawnOptions, seleniumArgs, function started(err, server) {
  // or, var server = selenium();
  // returns ChildProcess instance
  // http://nodejs.org/api/child_process.html#child_process_class_childprocess

  // spawnOptions defaults to `{ stdio: 'inherit' }`
  // seleniumArgs defaults to `[]`

  server.stdout.on('data', function(output) {
    console.log(output);
  });
});

IEDriverServer architecture

IEDriverServer 32/64bit version is downloaded according to processor architecture. There are known issues with sendkeys being slow on 64bit version of Internet Explorer. To address this issue, IEDriverServer architecture can be configured using IEDRIVER_ARCH environment variable. Supported values are ia32 and x64.

Example: Force 32bit IEDriverServer to be used

set IEDRIVER_ARCH=ia32
npm install selenium-standalone@latest -g
start-selenium

selenium-standalone versions maps selenium versions.