Skip to content

Instantly share code, notes, and snippets.

@marcuswestin
Created March 21, 2011 21:29
Show Gist options
  • Save marcuswestin/880254 to your computer and use it in GitHub Desktop.
Save marcuswestin/880254 to your computer and use it in GitHub Desktop.
Get started using Selenium with SauceLabs and NodeJS
require('soda').createSauceClient({ 'username': 'username-string', 'access-key': 'access-key-string',
'url': 'http://example.saucelabs.com/', 'max-duration': 300,
'os': 'Windows 2003', 'browser': 'firefox', 'browser-version': '3.6',
'name': 'This is an example test' }).chain.session()
.open('/')
.getTitle(function(title){
require('assert').ok(~title.indexOf('Cross browser testing with Selenium - Sauce Labs'), 'Title did not include the query');
})
.testComplete()
.end(function(err){
if (err) throw err;
console.log('done');
})
.on('command', function(cmd, args){
console.log(' \x1b[33m\x1b[0m: ', cmd, args.join(', '));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment