Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Created September 2, 2018 12:49
Show Gist options
  • Save AllenFang/64929e927f743be7b7465396977347ce to your computer and use it in GitHub Desktop.
Save AllenFang/64929e927f743be7b7465396977347ce to your computer and use it in GitHub Desktop.
import webdriver from 'selenium-webdriver';
import { Driver, Options } from 'selenium-webdriver/chrome';
const EXT_PATH = //YOUR_LOCAL_EXTENSION_PATH
const chromeOptions = { args: [`load-extension=${EXT_PATH}`] };
const driver = new webdriver.Builder()
.withCapabilities({ chromeOptions })
.build();
// You can start work with driver now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment