Skip to content

Instantly share code, notes, and snippets.

@christian-bromann
Last active December 30, 2015 21:10
Show Gist options
  • Save christian-bromann/6358232 to your computer and use it in GitHub Desktop.
Save christian-bromann/6358232 to your computer and use it in GitHub Desktop.
Use Webdriverjs with Sauce Labs (example)
var webdriverjs = require('../index'),
client = webdriverjs.remote({
desiredCapabilities: {
browserName: 'chrome',
version: '27',
platform: 'XP',
tags: ['examples'],
name: 'This is an example test'
},
host: 'ondemand.saucelabs.com',
port: 80,
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,
logLevel: 'silent'
}).init();
client
.url('http://google.com')
.setValue('*[name="q"]','webdriverjs')
.click('*[name="btnG"]')
.pause(1000)
.getTitle(function(err,title) {
console.log(title);
})
.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment