question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting Chrome Options

See original GitHub issue

I’d like to add some extensions to my chrome instance, using the WebDriver JavaScript API I would do this:

var options = new chrome.Options().
    addExtensions("pathToExtension");

var driver = new webdriver.Builder().
    withCapabilities(webdriver.Capabilities.chrome()).
    setChromeOptions(options).
    build();

How would I do the same thing in protractor?

It looks like you are parsing the capabilities section of the JSON to work out how to build the driver object, but I don’t see anything in the structure that would accept a series of options.

As a side note is there a google group/mailing list for protractor, it would be good to put queries like this there rather than cluttering up the issues list.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
juliemrcommented, Oct 28, 2013

Hi! You can set options in the Capabilities object - such as:

capabilities {
  'browserName': 'chrome',
  'chromeOptions': {
    'extensions': ['pathToExtension']
  }
}
1reaction
lksvcommented, Nov 4, 2013

I was facing the similar problem when I tried to test chromiumembedded app (I need to set up chrome binary path).

The solution is set the binary key and also some other keys even there are empty (it is due to that capabilities is pased to the selenium-webdriver/chrome.js):

  capabilities: {
    'browserName': 'chrome',
    "chromeOptions": {
      binary: '/path/to/cef_binary',
      args: [], 
      extensions: [], 
    }   
  },  

…even cleaner solution should be use the Options instance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebDriver for Chrome - Capabilities & ChromeOptions
You can create an instance of ChromeOptions, which has convenient methods for setting ChromeDriver-specific capabilities.
Read more >
Chrome Options & Desired Capabilities in Selenium Webdriver
Selenium Chrome Options class is used to manipulate various properties of Chrome driver · Desired Chrome Capabilities class provides a set of key ......
Read more >
Capabilities & ChromeOptions - WebDriver for Chrome
Capabilities are options that you can use to customize and configure a ChromeDriver session. This page documents all ChromeDriver supported capabilities and how ......
Read more >
Set Chrome Options for Selenium Tests. | BrowserStack Docs
Customize and configure ChromeDriver sessions for Selenium tests on BrowserStack Automate. A ChromeDriver session i.e. a test running on the Chrome browser, ...
Read more >
Reset Chrome settings to default - Google Chrome Help
On your computer, open Chrome. · At the top right, click More More and then Settings. On Chromebook, Linux, and Mac: Click Reset...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found