Is it possible to add a plugin to chromedriver under a protractor test?

andrepm picture andrepm · Dec 3, 2014 · Viewed 8.3k times · Source

I've been trying to handle the basic authentication during my protractor test. Some hard time on it, so i've found a chrome plugin wich sends automatically my credentials for websites that require basic authentication.

As each time that chromedriver is executed, a new profile is loaded, how can i permanelty add a plugin to my tests? I know that there is https://sites.google.com/a/chromium.org/chromedriver/extensions, but i dont think this very clear.

Answer

Andres D picture Andres D · Dec 3, 2014

Check this: https://github.com/andresdominguez/elementor/blob/master/bin/elementexplorer.js#L194

Here I am loading an extension from a local directory. The extension is not a crx file, but the uncompressed version.

'chromeOptions': {
  'args': ['--load-extension=' + extensionPath]
}