Last active
August 20, 2019 15:28
-
-
Save rordi/aa791274e4717b0f3a3db37bb1da7905 to your computer and use it in GitHub Desktop.
Javascript Selenium Web Driver with Chrome Options
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
const {Builder, By, Capabilities} = require('selenium-webdriver'); | |
let chromeCapabilities = Capabilities.chrome(); | |
let chromeOptions = { | |
'args': ['--test-type', '--headles', '--incognito', '--window-size=340,750'] // approx. size of an iPhone 5/SE | |
}; | |
// "chromeOptions" was changed to "goog:chromeOptions" at some point... | |
chromeCapabilities.set('goog:chromeOptions', chromeOptions); | |
let driver = await new Builder().forBrowser('chrome').withCapabilities(chromeCapabilities).build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment