Created
May 18, 2018 05:16
-
-
Save keithpotter21/c54b734267c507d3b94c3d6373dc0657 to your computer and use it in GitHub Desktop.
Setup selenium-webdriver with chrome options to change download directory.
This file contains hidden or 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'), | |
chromeDriver = require('selenium-webdriver/chrome'), | |
By = require('selenium-webdriver').By, | |
until = require('selenium-webdriver').until; | |
var options = new chromeDriver.Options(); | |
options.addArguments('start-maximized'); | |
options.addArguments('incognito'); | |
options.setUserPreferences({'download.default_directory' : '/path/to/your/download/directory'}); | |
var driver = new webdriver.Builder() | |
.withCapabilities(webdriver.Capabilities.chrome()) | |
.forBrowser('chrome') | |
.setChromeOptions(options) | |
.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment