Skip to content

Instantly share code, notes, and snippets.

@apdarshan
Created December 29, 2017 09:00
Show Gist options
  • Save apdarshan/2f22cd4612db3748c149da9215cc51fe to your computer and use it in GitHub Desktop.
Save apdarshan/2f22cd4612db3748c149da9215cc51fe to your computer and use it in GitHub Desktop.
WebdriverIO in Chrome Headless using chromedriver
process.env['PLATFORM_ARCH_OVERRIDE'] = 'x64';
const webdriverio = require('webdriverio');
const chromedriver = require('chromedriver'); //using https://www.npmjs.com/package/chromedriver
const PORT = 9515;
chromedriver.start([
'--url-base=wd/hub',
`--port=${PORT}`,
'--verbose'
]);
const opts = {
port: PORT,
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {args: ['--headless']}
}
};
browser = webdriverio.remote(opts).init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment