BE A COOL KID
write selenium in Node.JS
http://www.oscon.com/
Open source software, architecture, frameworks, and
tools for today’s engineers
If software is what you do, OSCON is where you want
to be (4,182 +/- software engineers each year can’t be
wrong). Meet the full stack, face to face.
seleniumconf.org
WHAT IS NODE.JS?
simply it is server side javascript
nodejs.org
+ =
WHAT IS IO.JS?
don’t piss of the community
iojs.org
+ =+
=
foundation
+
ES6 IS COMING LIKE WINTER
kangax.github.io/compat-table/es6/
INSTALLING NODE
Use NodeVersion Manger you can thank me later

https://github.com/creationix/nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash


nvm install iojs

nvm install 0.10

nvm use 0.10

NODE PACKAGE MANGER
NPM installed with Node.js

https://www.npmjs.com/

Manage your package dependencies & a little bit
more

NODE PACKAGE MANGER
package.json


npm install 

will install everything in the package.json file.
npm install <package_name>


GULP & GRUNT
BUILDTOOLS
The cool kids use gulp, it is newer and shiny.

Gulp streams file generation instead of writing temp
copies.

Gulp is much faster, Grunt has more plugins
http://gruntjs.com/http://gulpjs.com/
JASMINE & MOCHA
TEST FRAMEWORKS
Holy war like JUnit andTestNG
Jasmine is older, more documentation and has mocking and assertions built in

Mocha is newer and lets you choose what mocking and assertions libraries you want
http://jasmine.github.io/ http://mochajs.org/
SO MANY CHOICES FOR
SELENIUM & JAVASCRIPT
WEBDRIVER.JS
https://code.google.com/p/selenium/wiki/WebDriverJs
Official Selenium Project Javascript bindings

Most downloaded selenium package

Difficult to find online community support

Project Lead - Jason Leyba - California - Google


Late to the party - don’t get confused with Webdriver.JS that is now
Webdriver.io
WEBDRIVER.IO
http://webdriver.io/

Has the coolest logo!

Started before Selenium Project javascript bindings and was called webdrver.js


Awesome documentation!

Nice framework

Project Lead - Christian Bromann - Berlin - Sauce Labs


WD.JS
http://admc.io/wd/ 

Framework Appium project uses for testing Appium

Project Lead - Adam Christian - California - Sauce
Labs

A little obscure, mostly developed specifically for
Adam’s and few others needs.
NIGHTWATCH.JS
http://nightwatchjs.org/

The simplest to get up and running

Includes test runner, test framework and assertion framework

Good Documentation and Community

Test framework limited functionality compared to Mocha & Jasmine
Project Lead - Andrei Rusu - Norway - Confirmit


PROTRACTOR.JS
https://angular.github.io/protractor/#/ 

Wrapper around webdriver.js

Best community!

Project Lead - Julie Ralph - Washington - Google

Mainly created for AngularJS apps and has ability to know
AngularJS app state

Can be used with non-angular sites, simple config change

Best built in parallel running ability

ASYNCHRONOUS
If you are not use to programming asynchronously
that can be a challenge to get use to
ASYNCHRONOUS
the answer
THE CALLBACK
CALLBACK HELL
async1(function(input, result1) {
async2(function(result2) {
async3(function(result3) {
async4(function(result4) {
async5(function(output) {
// do something with output
});
});
});
});
})
THE PROMISE
A promise is an object that represents a value, or the eventual
computation of a value

Promises save you from callback hell

Promises make it easier to read code

Promises come with ES6

You can also use libraries like Q https://github.com/kriskowal/q with
older versions of node.js



THE PROMISE
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
Global_Objects/Promise
THANKYOU
@jameseisenhauer

A Introduction to the World of Node, Javascript & Selenium