Created
June 21, 2017 04:47
-
-
Save gomo/4ccd61095388c39d813bfbcd2bdcb3f3 to your computer and use it in GitHub Desktop.
Javascript selenium with headless chrome
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
import webdriver from 'selenium-webdriver' | |
import test from 'selenium-webdriver/testing' | |
test.describe('Test', () => { | |
test.it('with headless chrome.', () => { | |
const chromeCapabilities = webdriver.Capabilities.chrome(); | |
chromeCapabilities.set('chromeOptions', { | |
'args': ['--headless', '--disable-gpu'] | |
}); | |
driver = new webdriver.Builder() | |
.usingServer('http://localhost:4444/wd/hub') | |
.withCapabilities(chromeCapabilities) | |
.build(); | |
driver.get('http://www.google.com/'); | |
driver.quit(); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesting. When I do this Chrome still pops up.