0

I am working through a PackT book "AngularJS UI Development". Every thing has gone well, until I started working with Selenium/Protractor section on page 26 of 235. I have tried the solutions offered here on SO, but none of them have worked so far. Operating environment:

  • Protractor version 1.6.1
  • Node version 0.12.0
  • Karma version 0.12.31
  • AngularJS version 1.3.1
  • Windows 7 machine
  • Java (JRE) version 8 update 31

The error log says that protractor can not find AngularJS in my index.html file. This is my first time working with Protractor and Selenium.

I have my project up on github at github

So where have I gone wrong??? I would like to get through this and prove that angular development can be done here at a eLearning development company. tony

index.htm :

<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>Hello World AngularUI</title>
    <link rel='stylesheet' href='css/main.css' />
  </head>
  <body data-ng-app="myApp">
    <div data-ng-controller="helloWorldCtrl">
    <div hello-world name="name"></div>
      <hello-world name='name'></hello-world>
    </div>
    <script src="bower/angular/angular.min.js"></script>
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src='js/directives.js'></script>
  </body>
</html>
3
  • 1
    I advice you to place your script tags in the <head> Commented Feb 11, 2015 at 16:55
  • 1
    You are also missing a </div> tag. (closing the controller div) Commented Feb 11, 2015 at 16:57
  • Arnaud Denoyelle, Thanks for the information. And I could not see where I left a html closure out, but I did move my angular.min.js script tag to the head section. But this seems counter intuitive from what standards are with javascript script tags being after all the content and just above the body closure in html. But when I took your suggestion and moved it to the head, my error changed to browser not defined. I have both Chrome and Firefox loaded on this machine. So I tried changing my conf.js so that it is supposed to target 'firefox'. I still come up with same problem. Commented Feb 11, 2015 at 20:05

1 Answer 1

1

I looked at your git hub in your spec file (ch01/test/protractor/spec.j) you misspelled browser as broswer on line 3

Sign up to request clarification or add additional context in comments.

1 Comment

Dangh, thanks for the pointer. I noticed that yesterday after figuring out that something is definitely wrong with my project set up. I found it when I compared the author's book example to what I hand-typed. I am still getting errors though. My last ditch effort was to take the example test set up that comes with Protractor and run it on my machine to make sure Node, Protractor and everything else was set up correctly. Those particular results proved a wealth of knowledge being that Protractor's example passed. So I have believability in my set up. Just something not right in my proj.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.