Skip to content

Running your own WebDriver server

Colin Snover edited this page Jun 24, 2014 · 3 revisions

Intern uses the Selenium WebDriver protocol to drive remote browsers. To create your own Selenium installation that supports all browsers on a given platform, you will need to download the following:

To run a standalone Selenium server that will allow you to access all of the browsers installed on the local machine, simply run:

java -jar selenium-server-standalone-2.xx.x.jar

The server will then be accessible from http://localhost:4444/wd/hub. Intern is preconfigured to use this location by default.

To use ChromeDriver and IEDriver with a Selenium server, the driver executables must either be placed somewhere in the environment PATH or their locations must be specified explicitly to the Selenium server using the -Dwebdriver.chrome.driver (ChromeDriver) and -Dwebdriver.ie.driver (IEDriver) flags upon starting the Selenium server.

The Selenium server can also act as a Selenium Grid hub by running:

java -jar selenium-server-standalone-2.xx.x.jar -role hub

Running a hub allows you to specify a single WebDriver host within your Intern configuration that will then redirect Intern to use any Selenium servers matching the requested environment that have registered themselves with the hub and are available for use.

Once a grid hub has been started, each Selenium server node then needs to be started and registered with the hub:

java -jar selenium-server-standalone-2.xx.x.jar -hub http://hub-server:4444/grid/register

Creating a grid that works with Selendroid and ios-driver requires that additional selendroid-grid-plugin and ios-grid-plugin plugins be downloaded and added to the Java classpath when starting the grid hub:

java -Dfile.encoding=UTF-8 -cp "selendroid-grid-plugin-0.x.x.jar:ios-grid-plugin-0.x.x.jar:selenium-server-standalone-2.xx.x.jar" org.openqa.grid.selenium.GridLauncher -capabilityMatcher io.selendroid.grid.SelendroidCapabilityMatcher -role hub

Note that when running on Windows, the colons (:) in the -cp argument must be replaced with semicolons (;).

Firefox, Safari, Chrome, Chrome for Android, and Internet Explorer will all be available using a standard Selenium server node. Selendroid and ios-driver, in contrast, use their own custom Selenium servers (selendroid-standalone-0.x.x-with-dependencies.jar and ios-server-standalone-0.x.x.jar), which must be run and registered separately with the hub. ios-driver uses the same hub registration method as the standard Selenium server (-hub http://hub-server…); Selendroid requires manual registration to the hub.

More information on installation and configuration of each driver can be found on the following sites: