title: How do I pass browser as a command line parameter when launching tests
body: <p>I am trying to run multi-browser testing against Chrome and Firefox. 
  I would like to only run one browser at a time. So I would like to pass into  test a command line parameter <code>--browser chrome</code> for example and have it only run the chrome browser. </p>
  
  <p>I read somewhere that I could do a <code>params: {}</code> section of my protractor.config.js. </p>
  
  <p>So I added the following: </p>
  
  <pre><code>params: {
      browser: multiCapabilities.browserName,
  },
  </code></pre>
  
  <p>The error that I am getting is below:</p>
  
  <pre><code>ReferenceError: multiCapabilities is not defined
  at Object.&lt;anonymous&gt; (/Users/csalisbury/src/helios/protractor.config.js:91:18)
  at Module._compile (internal/modules/cjs/loader.js:678:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
  at Module.load (internal/modules/cjs/loader.js:589:32)
  at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
  at Function.Module._load (internal/modules/cjs/loader.js:520:3)
  at Module.require (internal/modules/cjs/loader.js:626:17)
  at require (internal/modules/cjs/helpers.js:20:18)
  at ConfigParser.addFileConfig (/Users/csalisbury/src/helios/node_modules/protractor/built/configParser.js:135:26)
  at Object.initFn [as init] (/Users/csalisbury/src/helios/node_modules/protractor/built/launcher.js:93:22)
  </code></pre>
  
  <p>There is a <code>multiCapabilities</code> section defined. I also tried this with <code>capabilities</code> and got the same message. </p>
  
  <p>What am I doing incorrectly here?</p>
  
  <p>Here is my <code>protractor.config.js</code></p>
  
  <pre><code>exports.config = {
  suites: {
      &lt;test suites go here&gt;
  },
  baseUrl: baseUrl,
  directConnect: false,
  allScriptsTimeout: 25 * 1000,
  jasmineNodeOpts: {
      defaultTimeoutInterval: 90 * 1000
  },
  getPageTimeout: 120 * 1000,
  capabilities: {
      browserName: 'chrome',
      seleniumAddress: seleniumServer,
      platform: 'ANY',
      version: 'ANY',
      chromeOptions: {
          args: ['--no-sandbox', '--test-type=browser', '--lang=en', '--window-size=1680,1050'],
          prefs: {
              'credentials_enable_service': false,
              'profile': {
                  'password_manager_enabled': false
              },
              download: {
                  prompt_for_download: false,
                  directory_upgrade: true,
                  default_directory: 'C:\\downloads\\'
              },
          },
      },
      loggingPrefs: { browser: 'SEVERE' }
  },
  capabilities: {
      browserName: 'firefox',
      'moz:firefoxOptions': {
          args: ['--safe-mode'],
          binary: '/Applications/Firefox.app/Contents/MacOS/firefox'
      },
      seleniumAddress: seleniumServer,
  },
  
  framework: 'jasmine2',
  onPrepare: function() {
      //Set Up a JUnit XML Reporter - Makes a nice test results area and trend graph in Jenkins
      var jasmineReporters = require('jasmine-reporters');
      jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
          consolidateAll: true,
          savePath: 'report',
          filePrefix: 'xmloutput'
      }));
  
      //Setup screenshots
      jasmine.getEnv().addReporter(reporter);
  
      browser.get(browser.baseUrl);
  },
  // Setup the report before any tests start
  beforeLaunch: function() {
      return new Promise(function(resolve) {
          reporter.beforeLaunch(resolve);
      });
  },
  // Close the report after all tests finish
  afterLaunch: function(exitCode) {
      return new Promise(function(resolve) {
          reporter.afterLaunch(resolve.bind(this, exitCode));
      });
  },
  </code></pre>
  
  <p>};</p>