Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
20160926-setup.coffee
# Load the Chrome extension and convert to base64 format.
# This is specific to how the node-selenium webdriver sets up its capabilities.
# Refer to http://stackoverflow.com/a/27278322/2204868 for more info.
data = fs.readFileSync '/tmp/location/of/extension.crx'
encodedExtension = data.toString 'base64'
capabilities =
browserName: 'chrome'
chromeOptions:
extensions: [encodedExtension] # This needs to be a base64 String array of our extensions.
# This is the driver you can now use to power all of your tests.
@driver = new webdriver
.Builder()
.withCapabilities(capabilities)
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.