title: Protractor e2e test case for download file work fine on chrome but not with firefox and vice versa?
body: <p>I have a scenario where I need to click on a link which will trigger <strong>.CSV</strong> file download to a default location(/tmp)and it is working fine on both chrome and firefox browsers but based on multiCapabilities configuration in conf.js, at times it work only on single browser(means one set of configuration helps in chrome working fine but not the firefox and the other set results in firefox to work but not the chrome).And I used the following stackoverflow post as the reference : <a href="https://stackoverflow.com/questions/21935696/protractor-e2e-test-case-for-downloading-pdf-file#comment63909844_26127745">Protractor e2e test case for downloading pdf file</a>. And my attempt worked fine someway but then script hits only on chrome or firefox based on multiCapabilities configuration I used.</p>
  
  <p>Please note that chrome will work with following config and in this I haven't added the firefox profile setup . So file download part in firefox wont work with the following configuration.</p>
  
  <pre><code>multiCapabilities: [
      {
          'browserName': 'chrome',
          'platform': 'ANY',
          'chromeOptions': {
              args: ['--no-sandbox', '--test-type=browser'],
              prefs: {
                  download: {
                      'prompt_for_download': false,
                      'directory_upgrade': true,
                      'default_directory': '/tmp'
                  }
              }
          }
      },
      {
          'browserName': 'firefox',
      }
  ],
  </code></pre>
  
  <hr>
  
  <p>Based on the above mentioned url(<a href="https://stackoverflow.com/questions/21935696/protractor-e2e-test-case-for-downloading-pdf-file#comment63909844_26127745">Protractor e2e test case for downloading pdf file</a>) I added the function getFirefoxProfile() in my util file : common.js</p>
  
  <pre><code>var getFirefoxProfile = function() {
      var deferred = q.defer();
      var firefoxProfile = new FirefoxProfile();
      firefoxProfile.setPreference("browser.download.folderList", 2);
      firefoxProfile.setPreference("browser.download.manager.showWhenStarting", false);
      firefoxProfile.setPreference("browser.download.dir", '/tmp');
      firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/comma-separated-values, text/csv, application/csv, application/excel, application/vnd.ms-excel, application/vnd.msexcel, text/anytext");
      firefoxProfile.encoded(function(encodedProfile) {
          var multiCapabilities = [{
              browserName: 'firefox',
              firefox_profile : encodedProfile
          }];
          deferred.resolve(multiCapabilities);
      });
      return deferred.promise;
  }
  exports.getFirefoxProfile = getFirefoxProfile;
  </code></pre>
  
  <p>And then I updated the conf.js as follows:</p>
  
  <pre><code>getMultiCapabilities: com.getFirefoxProfile,
  multiCapabilities: [
      {
          'browserName': 'chrome',
          'platform': 'ANY',
          'chromeOptions': {
              args: ['--no-sandbox', '--test-type=browser'],
              prefs: {
                  download: {
                      'prompt_for_download': false,
                      'directory_upgrade': true,
                      'default_directory': '/tmp'
                  }
              }
          }
      },
      {
          'browserName': 'firefox',
      }
  ],
  </code></pre>
  
  <p>And <strong>getMultiCapabilities: com.getFirefoxProfile</strong> when used in conf.js will override both capabilities and multiCapabilities mentioned in the conf.js and when I run my script, it executes the script only on firefox and not in chrome. 
  Any idea on how to fix this? And my requirement is to login to chrome, perform the csv download, logout from chrome, then login to firefox and do the same.</p>
  
  <p>Any help would be greatly appreciated..</p>