title: Protractor fails to find Angular
body: <p>I can't seem to get Protractor to realize that Angular is loaded and running. When it opens Chrome my app loads fully in the browser, so I know that Angular is loaded and running correctly.</p>
  
  <p>The config file:</p>
  
  <pre><code>exports.config = {
  seleniumServerJar: 'C:/Dev/PrismWeb/selenium/selenium-server-standalone-2.35.0.jar',
  
  seleniumPort: null,
  
  chromeDriver: 'C:/Dev/PrismWeb/selenium/chromedriver.exe',
  
  seleniumArgs: [],
  
  seleniumAddress: null,
  
  allScriptsTimeout: 110000,
  
  specs: ['c:/dev/prismweb/test/e2e/*.js'],
  
  capabilities: {'browserName': 'chrome'},
  
  baseUrl: 'http://localhost:8080',
  
  rootElement: 'html',
  
  jasmineNodeOpts: {
      onComplete: null,
      isVerbose: true,
      showColors: true,
      includeStackTrace: true,
      defaultTimeoutInterval: 30000
  }
  };
  </code></pre>
  
  <p>I've only got one test that I am trying to run and it fails because Protractor can't find Angular.</p>
  
  <p>The Test:</p>
  
  <pre><code>describe('homepage loads: ', function(){
  var ptor;
  
      ptor = protractor.getInstance();
  
      beforeEach(function(){
          ptor.get('/');
      });
  
  it('should load the prism homepage: ', function(){
      var usernameField = ptor.findElement(protractor.By.id("username"));
      //expect(usernameField).toBeDefined();
  });
  });
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <blockquote>
    <p>UnknownError: javascript error: angular is not defined   (Session
    info: chrome=30.0.1599.69)   (Driver info:
    chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The
    server did not provide any stacktrace information) Command duration or
    timeout: 19 milliseconds Build info: version: '2.35.0', revision:
    'c916b9d', time: '2013-08-12 15:42:01' System info: os.name: 'Windows
    7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21'
    Session ID: 1ef7dcd7c5fc9c4e9e1dede050002adf Driver info:
    org.openqa.selenium.chrome.ChromeDriver Capabilities [{platform=XP,
    acceptSslCerts=true, javascriptEnabled=true, browserName=chrome,
    chrome={chromedriverVersion=2.2}, rotatable=false,
    locationContextEnabled=true, version=30.0.1599.69,
    cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true,
    browserConnectionEnabled=false, webStorageEnabled=true,
    nativeEvents=true, applicationCacheEnabled=false,
    takesScreenshot=true}]</p>
  </blockquote>
  
  <p>I've tried moving the ng-app attribute to the body tag (and changing the config accordingly) but I got the same error. We also have an ng-controller attribute on the html tag, and I tried moving that to the body and leaving the ng-app attribute alone on the html tag, but the result was the same. Does anybody have any insight as to why this fails?</p>
  
  <p>EDIT:
  Just a couple of notes that might help. I've updated the test above to include the manual bootstrapping efforts. The script tags for Angular and all of the modules are located at the bottom of the page, right before the closing BODY tag. The HTML tag still has the ng-app="myApp" attribute plus the ng-controller="baseController" attribute. If I try to bootstrap the app manually in the test, I get the following:</p>
  
  <pre><code>ReferenceError: angular is not defined
  </code></pre>
  
  <p>One other thing that worries me is that one of the modules we use absolutely needs "$" to be mapped to jQuery, so we map it like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var $jq=jQuery.noConflict();
      var $=jQuery.noConflict();
  &lt;/script&gt;
  </code></pre>
  
  <p>Where the ng-app is included:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app="prismApp" ng-controller="baseController"&gt;
  &lt;head&gt;
  </code></pre>