Last active
February 14, 2016 21:26
-
-
Save remarkablemark/806f0b95ef64073e0331 to your computer and use it in GitHub Desktop.
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
var webdriver = require('selenium-webdriver'); | |
// since no browser is specified in the builder | |
// you can set the target browser at runtime | |
// through the SELENIUM_BROWSER environment variable | |
// e.g., SELENIUM_BROWSER=phantomjs node driver_test.js | |
var driver = new webdriver.Builder().build(); | |
driver.get('https://www.google.com'); | |
driver.getTitle().then(function(title) { | |
console.log(title); | |
}); | |
driver.quit(); |
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
{ | |
"name": "webdriverjs-example", | |
"version": "0.0.1", | |
"description": "A simple WebDriverJS example.", | |
"main": "driver_test.js", | |
"dependencies": { | |
"selenium-webdriver": "^2.48.2" | |
}, | |
"devDependencies": {}, | |
"engines": { | |
"node": ">=4.2" | |
}, | |
"scripts": {}, | |
"author": "Mark <mark@remarkablemark.org>", | |
"license": "MIT" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment