Created
December 15, 2013 23:08
-
-
Save vvo/7979654 to your computer and use it in GitHub Desktop.
simple webdriverjs example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['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