Skip to content

Instantly share code, notes, and snippets.

@remarkablemark
Last active February 14, 2016 21:26
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 remarkablemark/806f0b95ef64073e0331 to your computer and use it in GitHub Desktop.
Save remarkablemark/806f0b95ef64073e0331 to your computer and use it in GitHub Desktop.
WebDriverJS example
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();
{
"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