Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Chrome preferences for browserstack #1354

Closed
alecxe opened this issue Sep 22, 2014 · 3 comments
Closed

Chrome preferences for browserstack #1354

alecxe opened this issue Sep 22, 2014 · 3 comments

Comments

@alecxe
Copy link
Contributor

alecxe commented Sep 22, 2014

I'm experiencing a weird issue and I'm not sure on which side things go wrong.

I have a couple of tests with disabled javascript and disabled cookies. In order to disable js, you need to pass --disable-javascript argument in the chrome arguments; in oder to disable cookies, you need to set profile.default_content_settings.cookies preference to 2. This is proven to work for me.

The problem is that setting prefs object inside the chromeOptions doesn't work for browserstack:

capabilities: {
    'browserstack.user' : browserstackUser,
    'browserstack.key' : browserstackKey,
    'browserstack.local' : 'true',
    'browserstack.debug': 'true',

    'browserName' : 'chrome',
    'os' : 'OS X',
    'os_version' : 'Mavericks',
    'resolution' : '1024x768',

    chromeOptions: {
        args: [
            '--disable-javascript'
        ],
        prefs: {
            'profile.default_content_settings.cookies': 2
        }
    },

    specs: [
        'disabledCookies/*.js'
    ]
},

In this case javascript would get disabled, but cookies would be still enabled.

FYI, running the tests locally (changing seleniumAddress and omitting browserstack-specific keys) works perfectly.

Is it something on the protractor's side, or the problem is browserstack-specific? Thank you.

@juliemr
Copy link
Member

juliemr commented Sep 22, 2014

If it's running successfully locally, sounds like a browserstack problem to me.

@UmangSardesai
Copy link

This works for me. Just checked on BrowserStack.

var capabilities = {
  'browserName' : 'chrome',
  'browser_version' : '46.0',
  'browserstack.user' : '<username>',
  'browserstack.key' : '<automate-key>', 
  'chromeOptions': {
        prefs: {
          profile: {
            default_content_settings: {
              cookies: 2
            }
          }
        }
    } 
}

@alecxe
Copy link
Contributor Author

alecxe commented Dec 17, 2015

@UmangSardesai thank you, I'll try that!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants