title: Protractor pointing to Sauce Labs Selenium Server
body: <p>I'm trying to integrate Protractor with Sauce Labs from Travis. I can get the sauce_connect server running correctly but am unable to get Travis to point to that particular remote server. </p>
  
  <p>Travis will get to the point where it initiates sauce_connect but when I run "protractor:analytics" it doesn't point to the correct server and fails. </p>
  
  <h1>Travis.yml:</h1>
  
  <pre><code>language: python
  python:
  - 3.2_with_system_site_packages
  branches:
    only:
    - develop
  before_install:
  - sudo apt-get update -qq
  - sudo apt-get install python-numpy
  install:
  - cd lib &amp;&amp; python setup.py install
  - cd .. &amp;&amp; pip install -r requirements/travis_requirements.txt
  - npm install
  script:
  - grunt karma:single
  - grunt protractor:analytics
  env:
    global:
    - secure: &lt;string&gt;
    - secure: &lt;string&gt;
  sauce_connect: true
  </code></pre>
  
  <h1>Gruntfile:</h1>
  
  <pre><code>protractor: {
    options: {
      configFile: './webapp/static/test/e2e/protractor.conf.js',
      keepAlive: true
    },
    singlerun: {},
    analytics: {
      options: {
        //debug : true,
        args:{
          specs: ['./webapp/static/test/e2e/analytics_spec.js']
        }
      }
    },
  },
  </code></pre>
  
  <h1>Protractor Conf:</h1>
  
  <pre><code>exports.config = {
    chromeOnly: false,
    seleniumArgs: [],
  
    // If sauceUser and sauceKey are specified, seleniumServerJar will be ignored.
    // The tests will be run remotely using SauceLabs.
    sauceUser: process.env.SAUCE_USER,
    sauceKey: process.env.SAUCE_KEY,
  
    baseUrl: 'http://localhost:8000',
    specs: [
      './*_spec.js',
    ],
  
    // Patterns to exclude.
    exclude: [],
  
    multiCapabilities: [],
  
    // ----- More information for your tests ----
    //
    // A base URL for your application under test. Calls to protractor.get()
    // with relative paths will be prepended with this.
    baseUrl: process.env.SN_BASE_URL,
  
    // Selector for the element housing the angular app - this defaults to
    // body, but is necessary if ng-app is on a descendant of &lt;body&gt;
    rootElement: 'body',
  
    // A callback function called once protractor is ready and available, and
    // before the specs are executed
    // You can specify a file containing code to run by setting onPrepare to
    // the filename string.
    onPrepare: function() {
      // At this point, global 'protractor' object will be set up, and jasmine
      // will be available. For example, you can add a Jasmine reporter with:
      //     jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
      //         'outputdir/', true, true));
    },
  
    // The params object will be passed directly to the protractor instance,
    // and can be accessed from your test. It is an arbitrary object and can
    // contain anything you may need in your test.
    // This can be changed via the command line as:
    //   --params.login.user 'Joe'
    params: {
      login: {
        user: process.env.SN_TEST_USERNAME,
        password: process.env.SN_TEST_PASSWORD
      }
    },
    framework: 'jasmine',
  
    // ----- Options to be passed to minijasminenode -----
    //
    // See the full list at https://github.com/juliemr/minijasminenode
    jasmineNodeOpts: {
      // onComplete will be called just before the driver quits.
      onComplete: null,
      // If true, display spec names.
      isVerbose: false,
      // If true, print colors to the terminal.
      showColors: true,
      // If true, include stack traces in failures.
      includeStackTrace: true,
      // Default time to wait in ms before a test fails.
      defaultTimeoutInterval: 30000
    },
  
    onCleanUp: function() {}
  };
  </code></pre>