Skip to content

Instantly share code, notes, and snippets.

@vvo
Created December 15, 2013 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvo/7979654 to your computer and use it in GitHub Desktop.
Save vvo/7979654 to your computer and use it in GitHub Desktop.
simple webdriverjs example
['chrome', 'firefox'].forEach(detectBrowser);
function detectBrowser(name) {
require('webdriverjs')
.remote({
desiredCapabilities: {
browserName: name
}
})
.init()
.url('http://www.whatismybrowser.com/')
.getText('.detected.simple-browser-string', function(err, text) {
console.log(name + 'browser was detected as ' + text);
})
.end()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment