webdriverio

Install Selenium Standalone

$ npm install selenium-standalone@latest -g

############################################################# 
# selenium-standalone install
# Drivers are downloaed along with selenium-server
# chromedriver (v2.23)
# gechodriver (v0.10.0)
# iedriver (v2.53.1)
# selenium-server (v2.53.1)
# C:\Users\xxxxxxxx\AppData\Roaming\npm\node_modules\selenium-standalone\.selenium
# 
#############################################################
$ selenium-standalone install
$ selenium-standalone start

Please note selenium-server-standalone-3.0.0-beta2 wont work. It need to specify webdriver via system properties.

Test sample

var webdriverio = require(''webdriverio'');
var options = {
    desiredCapabilities: {
        browserName: ''firefox''
    }
};
 
webdriverio
    .remote(options)
    .init()
    .url(''http://www.google.com'')
    .getTitle().then(function(title) {
        console.log(''Title was: '' + title);
    })
    .end();

Starting Selenium Standalone

xxxxxxxx@mypc ~/ISR/CI/webdriverio-test
$ selenium-standalone start

Open another terminal

$ node test.js
Title was: Google

Log:

15:19:17.709 INFO - Launching a standalone Selenium Server
Setting system property webdriver.chrome.driver to c:\Users\xxxxxxxx\AppData\Roa
ming\npm\node_modules\selenium-standalone\.selenium\chromedriver\2.23-ia32-chrom
edriver
Setting system property webdriver.ie.driver to c:\Users\xxxxxxxx\AppData\Roaming
\npm\node_modules\selenium-standalone\.selenium\iedriver\2.53.1-ia32-IEDriverSer
ver.exe
Setting system property webdriver.gecko.driver to c:\Users\xxxxxxxx\AppData\Roam
ing\npm\node_modules\selenium-standalone\.selenium\geckodriver\0.10.0-ia32-gecko
driver
15:19:18.154 INFO - Java: Oracle Corporation 25.66-b17
15:19:18.154 INFO - OS: Windows 7 6.1 x86
15:19:18.191 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
15:19:18.432 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:19:18.432 INFO - Driver provider com.opera.core.systems.OperaDriver is not re
gistered
15:19:18.490 INFO - Driver provider org.openqa.selenium.safari.SafariDriver regi
stration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=
MAC}] does not match the current platform VISTA
15:19:18.502 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUni
tDriver
15:19:18.502 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver
is not registered
15:19:18.841 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:4444/wd/hub
15:19:18.841 INFO - Selenium Server is up and running
Selenium started
15:19:22.030 INFO - Executing: [new session: Capabilities [{rotatable=true, loca
tionContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPrefere
nces@308188, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, re
questOrigins={name=webdriverio, version=4.2.8, url=http://webdriver.io}}]])
15:19:22.068 INFO - Creating a new session for Capabilities [{rotatable=true, lo
cationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPrefe
rences@308188, browserName=firefox, javascriptEnabled=true, handlesAlerts=true,
requestOrigins={name=webdriverio, version=4.2.8, url=http://webdriver.io}}]
15:19:34.893 INFO - Done: [new session: Capabilities [{rotatable=true, locationC
ontextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@
308188, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, request
Origins={name=webdriverio, version=4.2.8, url=http://webdriver.io}}]]
15:19:35.336 INFO - Executing: [get: http://www.google.com])
15:19:42.983 INFO - Done: [get: http://www.google.com]
15:19:43.013 INFO - Executing: [get title])
15:19:43.045 INFO - Done: [get title]
15:19:43.059 INFO - Executing: [delete session: 7b6e6e44-0595-4052-9fd9-5d14e31d
b61c])
15:19:46.222 INFO - Done: [delete session: 7b6e6e44-0595-4052-9fd9-5d14e31db61c]
Show Comments