Created
March 1, 2016 02:11
-
-
Save remarkablemark/b317344af07546752611 to your computer and use it in GitHub Desktop.
WebDriverJS recipes
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
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var webdriver = require('selenium-webdriver'); | |
var chrome = require('selenium-webdriver/chrome'); | |
/** | |
* Chrome options. | |
*/ | |
var chromeOptions = new chrome.Options(); | |
// if profile exists, then use it | |
// otherwise, create new profile | |
var chromeProfilePath = './ChromeProfile/'; | |
chromeOptions.addArguments(['user-data-dir=' + chromeProfilePath]); | |
/** | |
* Build driver with options. | |
*/ | |
var driver = new webdriver.Builder().withCapabilities(chromeOptions).build(); | |
// confirm profile path | |
driver.get('chrome://version'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment