Features
< Back to Blog Overview

NodeJS and Selenium

2011-12-26
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn
  • Share on HackerNews

Today we've added support for NodeJS Selenium testing on our Selenium grid. Installation of our plugin is easy by using NPM (Node Package Manager).


To install our plugin, please run: npm install testingbot


A simple example of a NodeJS test:

var soda = require('soda')
, assert = require('assert');

var browser = soda.createTestingBotClient({
'url': 'http://www.google.com'
, 'os': 'Windows'
, 'browser': 'iexplore'
, 'browser-version': '8'
, 'max-duration': 300 // 5 minutes

});

// Log commands as they are fired

browser.on('command', function(cmd, args){
console.log(' \x1b[33m%s\x1b[0m: %s', cmd, args.join(', '));
});

browser
.chain
.session()
.setTimeout(8000)
.open('/')
.waitForPageToLoad(5000)
.getTitle(function(title){
assert.ok(~title.indexOf('Google'))
})
.end(function(err){
browser.testComplete(function() {
    if (err) throw err;
  });
});

To read more about our NodeJS plugin, please take a look at our support pages: https://testingbot.com/support/getting-started/nodejs.html


The repository of our NodeJS plugin is located on GitHub: https://github.com/testingbot/soda

TestingBot Logo

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.

Other Articles

blank

As mentioned before on this blog, we use a homemade utility to take screenshots of browser windows. Our tool, built in C#, will take a screenshot o...

Read more
blank

TestingBot updates

2011-12-23

It's been a busy week on TestingBot, here's what we did this week: Updated our grid from Selenium 2.15 to 2.16, the changelog reads:

Read more
blank

Today we're examining the captureNetworkTraffic selenium command, a little known gem in Selenium's command list. Selenium offers a feature, captu...

Read more
blank

We have just finished optimizing the video recording in our Selenium grid. Implementing this was harder than we thought, so here are some tips on h...

Read more
blank

After some more optimisations in our code and infrastructure we've now reached the point where the average simple test takes 9 seconds. Compared ...

Read more
blank

We've just finished upgrading our Selenium grid (the hub and all its RC nodes) to Selenium v2.15.0 This upgrade should provide improved stability.

Read more