Setting up a Windows Selenium Browser Host

selenium

Selenium, browser automation drivers and the browsers themselves should be release-controlled so that tests are performed against a known, reproducible environment.

The pace of browser updates is so rapid that updating them (Firefox and Chrome specifically) is done at the beginning of each sprint. This requires preventing automatic updates.

Prevent Firefox auto-update

Prevent Chrome auto-update

Prevent Internet Explorer 9 auto-update to 10

Prevent Internet Explorer 10 auto-update to 11

Install Selenium and drivers in C:\devTools\selenium or similar easy-to-reach location that can be standard on all selenium hosts.

Keep previous versions of Selenium and compatible drivers in C:\devTools\selenium2.3x

Put downloaded Selenium, drivers and browser installers in C:\devTools\selenium2.3x++

Start Selenium via a batch file

ECHO on
SET DIR=C:\DevTools\selenium
SET JAR=C:\DevTools\selenium\selenium-server-standalone-2.XX.0.jar
SET CONFIG=C:\DevTools\selenium\nodeConfig.json
java -jar %JAR% -hub http://192.168.1.254:4444/grid/register -role node -maxSession 20 -nodeConfig %CONFIG%

Use a nodeConfig.json file

{
"capabilities":
[
{
"browserName": "*Firefox",
"maxInstances": 20,
"seleniumProtocol": "Selenium",
"platform": "LINUX",
"version": "latest"
},
{
"browserName": "Firefox",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"platform": "WINDOWS",
"version": "latest"
},
{
"browserName": "IE",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"platform": "WINDOWS",
"version": "latest"
},
{
"browserName": "Chrome",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"platform": "WINDOWS",
"version": "latest"
},
],
"configuration":
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 20,
"port": 5555,
"host": 192.168.1.157,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": 192.168.1.254
}
}

Pitfalls: Google does not provide standalone installers for Chrome so there is no way to roll back to a previous version aside from using VM snapshots. They appear to have eradicated any sources of old version installers that were around the net at one time.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...

This site uses Akismet to reduce spam. Learn how your comment data is processed.