protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Cant seem to pass args to Chrome

Open bulkan opened this issue 12 years ago • 3 comments

Apologies up front for asking a question here as I've come to a dead end.

I believe this question is similar to this one month old Stack Overflow question...

I've installed protractor and webdriver-manager as per the tutorial on Mac OS X.

This is my config.js

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  baseUrl: 'https://localhost/mobile',

  specs: ['test.js'],
  'browserName': 'chrome',
  'chromeOptions': {
    'args': [
      '--keep-alive-for-test',
      "--window-size=320,580",
      '--test-type',
      '--use-mobile-user-agent',
      '--user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"'
    ]
  }
};

none of these arguments to chrome are having any effect to on the Chrome instance that starts up.

Am I doing something wrong ?

bulkan avatar Aug 13 '14 07:08 bulkan

Think you are missing the capabilities. This works for me:

specs: [
    'test/protractorTests/**/*.js'
  ],
capabilities: {
    'browserName': 'chrome',
    'chromeOptions' : {
        args: ['--lang=en']
    }
 },

zakrhol avatar Aug 13 '14 07:08 zakrhol

Thanks @zakrhol that worked.

I don't know how i missed this from reading the doc ಠ_ಠ

bulkan avatar Aug 13 '14 08:08 bulkan

@zakrhol Thanks a lot dear. Don't know how i missed that (facepalm)

iamhaseebiqbal avatar Jun 13 '18 10:06 iamhaseebiqbal