npm install selenium-standalone@latest -g selenium-standalone install selenium-standalone start
Last active
November 23, 2016 18:59
-
-
Save lazytesting/3e27896dbf146f8faffd70a90f26e936 to your computer and use it in GitHub Desktop.
Quick webdriver script
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": "wd", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"webdriverio": "^4.2.16" | |
} | |
} |
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 webdriverio = require('webdriverio'); | |
var options = { desiredCapabilities: { browserName: 'chrome' } }; | |
var client = webdriverio.remote(options); | |
client | |
.init() | |
.url('http://www.google.com') | |
.getTitle().then(function(title) { | |
console.log('Title is: ' + title); | |
}) | |
.end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment