To execute this code you need to have Node.js installed. It can be obtained at https://nodejs.org
Install the selenium-webdriver package:
npm install -g selenium-webdriver
I used the static-server package to host the sample login page:
npm install -g static-server
static-server -i login.html
To run the sample code:
node login.js