This post documents how I set up the Windows 8.1 Selenium node I was using for generating screenshots about Claro’s components.

Requirements

  • A Selenium hub instance that is able to accept node registrations.
  • A working and well-configured Windows 8.1 VirtualBox machine. If you don’t have this,
    • Download the IE11 on Win81 (x86) machine with VirtualBox platform.
    • Unzip the downloaded file and import the machine in VirtualBox.
    • Before you start it, open the settings of the machine, and
      • on the Display tab, set Video Memory to at least 27MB
      • on the Storage tab, add an empty optical drive to the IDE Controller (for guest additions)
      • on the Network tab, change the first network adapter to Bridged Adapter
    • Start the virtual machine (optionally: install Guest Additions and restart it).
  • Download and install the needed softwares:
  • Create a new selenium directory for your files and configurations, e.g in the root of the C:\\ drive.
  • Download and move these components into the new folder:
  • I think it is practical to rename the downloaded / extracted files to a filename that includes their version (we don’t have to run e.g. chromedriver --version all the time if we want to know the version we use).

Configuration and DX

The usual Selenium node config JSON:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  "capabilities": [
    {
      "browserName": "firefox",
      "maxinstances": 5,
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "chrome",
      "maxinstances": 5,
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "internet explorer",
      "maxinstances": 1,
      "seleniumProtocol": "WebDriver"
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "maxSession": 6,
  "port": 6011,
  "register": true,
  "registerCycle": 5000,
  "hub": "http://localhost:4444",
  "nodeStatusCheckTimeout": 5000,
  "nodePolling": 5000,
  "role": "node",
  "unregisterIfStillDownAfter": 60000,
  "downPollingLimit": 2,
  "debug": false,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {}
}

The batch script which starts the Selenium in node role:

1
2
3
4
5
6
7
8
9
10
11
12
@echo off
if "%~1" == "" (set ip=172.16.0.107) else (set ip=%~1)
@echo on

java ^
-Dwebdriver.chrome.driver="chromedriver-75.0.3770.90-win32.exe" ^
-Dwebdriver.ie.driver="IEDriverServer-win32-3.4.0.exe" ^
-Dwebdriver.gecko.driver="geckodriver-v0.24.0-win32.exe" ^
-jar selenium-server-standalone-3.4.0.jar ^
-role node ^
-hub http://%ip%:4444/grid/register ^
-nodeConfig selenium-node-config--3.4.0--win8.1.json

Profit

Launch your local Selenium hub, and in the Windows 8.1 guest, execute the batch script: selenium-node--win8.1.bat [OPTIONAL-HOST]. If you see “INFO - The node is registered to the hub and ready to use”, you can start using the node.