Protractor: Angular Never Provided resumeBootstrap

Created on 29 Jul 2014  Â·  13Comments  Â·  Source: angular/protractor

Why am I getting the following error?

Here is my conf.js

describe('angularjs homepage', function() {
  it('should have a title', function() {
browser.get('http://localdev.prereg.com/Facilities/Index');
    jasmine.log(browser.getTitle());
//expect(browser.getTitle()).toEqual('View Facilities - My ASP.NET Application');
  });
}); 

Using the selenium server at http://localhost:4444/wd/hub


Failures:

  1) angularjs homepage should have a title
   Message:
 Error: Angular could not be found on the page http://localdev.prereg.com/Facilities/Index : angular never provided
resumeBootstrap
   Stacktrace:
 Error: Angular could not be found on the page http://localdev.prereg.com/Facilities/Index : angular never provided
resumeBootstrap
at C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:1041:17
at C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1243:15

at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modul
es\selenium-webdriver\lib\webdriver\promise.js:1539:20)
at notify (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\pr
omise.js:362:12)
at notifyAll (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver
\promise.js:331:7)
at resolve (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\p
romise.js:309:7)
at fulfill (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\p
romise.js:429:5)
at Object.webdriver.promise.asap (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-web
driver\lib\webdriver\promise.js:671:5)
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modul
es\selenium-webdriver\lib\webdriver\promise.js:1550:25)
at notify (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\pr
omise.js:362:12)
==== async task ====
WebDriver.executeScript()
at webdriver.WebDriver.schedule (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webd
river\lib\webdriver\webdriver.js:268:15)
at webdriver.WebDriver.executeAsyncScript (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\sel
enium-webdriver\lib\webdriver\webdriver.js:496:15)
at Protractor.get (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:1035:15)
at null.<anonymous> (C:\_Git\protractor\MyTests\PreRegistration\spec.js:3:13)
at C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd\index.js:94:14
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modul
es\selenium-webdriver\lib\webdriver\promise.js:1539:20)
at webdriver.promise.ControlFlow.runEventLoop_ (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_module
s\selenium-webdriver\lib\webdriver\promise.js:1404:8)
==== async task ====
Asynchronous test function: it()
at null.<anonymous> (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd\index.js:93:33)

at null.<anonymous> (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\async
-callback.js:45:37)
at jasmine.Block.execute (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\
jasmine-1.3.1.js:1174:17)
at jasmine.Queue.next_ (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\ja
smine-1.3.1.js:2209:31)
at null._onTimeout (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmin
e-1.3.1.js:2199:18)
Error
at null.<anonymous> (C:\_Git\protractor\MyTests\PreRegistration\spec.js:2:3)
at jasmine.Env.describe_ (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\
jasmine-1.3.1.js:913:21)
at jasmine.Env.describe (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\j
asmine-1.3.1.js:898:15)
at describe (C:\Users\Tim\AppData\Roaming\npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1
.js:658:27)
at Object.<anonymous> (C:\_Git\protractor\MyTests\PreRegistration\spec.js:1:63)

Finished in 12.704 seconds
1 test, 1 assertion, 1 failure
question

Most helpful comment

I am not sure if this is the proper way to handle that error but I added this to my test and it worked.

beforeEach(function () {
browser.ignoreSynchronization = true;
});

All 13 comments

It appears that Protractor requires that the ng-app directive be on the BODY HTML tag because after I moved it there the error was gone and the test completed. Originally my ng-app was located on a DIV down in the page which is required in my case because the body tag is in my _Layout.cshtml file.

Can Protractor be configured to accommodate this?

I added rootElement: 'div' but now I get this error. "Error while waiting for Protractor to sync with the page: {}"

I am not sure if this is the proper way to handle that error but I added this to my test and it worked.

beforeEach(function () {
browser.ignoreSynchronization = true;
});

FYI - we are seeing this problem when we turn on ignoreSynchronization (to go to a non-angular page to set a cookie) then turn it back off to go to an angular page. Protractor waits for angular as it should, but then we get this error:

Error: Angular could not be found on the page http://local.directv.com:3001/movies : angular never provided resumeBootstrap

+1 on this- any resolutions here? Thanks!

I faced the same issue today on our CI infrastructure but not on my machine.

For now, I tried https://github.com/angular/protractor/issues/1464#issuecomment-71121970 but I had to tweak it further to something like:

angular.element(document).ready(function() {
  if (location.search.indexOf('test=protractor') > -1) {
    window.name = 'NG_DEFER_BOOTSTRAP!' + window.name;
    document.body.setAttribute('ng-app', '');
  }

  angular.bootstrap(document.body, [testModule.name]);
});

and adding the "test=protractor" string to the search of location does not help either.

After having changed the node.js version (to 0.10.32) I was able to reproduce the problem (I was using 0.12.0 before, which is working just fine).

The problem I faced got fixed. It was related to a transitive dependency breaking the execution of the bootstraping.
It was really odd and took me a be bit of time to spot where it came from.
Having the browser script errors passed to (node.js) protractor would probably have helped (I wonder if it is even possible)

I have this issue because I do manual bootstrapping so I don't even have the ng-app tag because I need to bootstrap after loading dependencies. How can I tell protractor when I do my manual bootstrapping so that it can detect angular app?

same as 'mkschreder' here

@zeropaper: Do you know if this solution still works? I find that safari 12 has the same behaviour

@evilaliv3 luckily, I don't need to work with angular since 5 years…
I guess you'll have to try.
Sorry I can't be more helpful.

Thank you anyway @zeropaper !

Was this page helpful?
0 / 5 - 0 ratings