1

I'm currently writing end-to-end-tests using protractor. With the selenium standalone server I'd like to run them on different browsers (on a win10-vm). Chrome works perfectly fine, but firefox constantly throws the following error:

Failed: Error while waiting for Protractor to sync with the page: [ng:test] no injector found for element argument to getTestability

The problem is, that this error doesn't occur always and also on different tests.

I did a lot of research and tried various rootElement approaches, such as:

'rootElement' = 'html'
'rootElement' = '[ng-app]'
'rootElement' = '.className'

But they don't work.

However, I found a workaround, using a browser.sleep() after I reload the page (which I do before each test). The problem might be that the ng-app isn't already set in my html tag when protractor continues after the page reload.

Because my workaround slows down the testing process in also isn't totally reliable I would prefer another solution. Can someone help me?

My config file:

exports.config = {
    seleniumAddress: 'http://myAddress',
    specs: ['mySpecs.js'],
    framework: 'jasmine2',
    rootElement:'html',
    multiCapabilities: [{
        'browserName': 'firefox'
    },{
        'browserName': 'chrome'
    }]
};

Thanks a lot, MH

MH_
  • 11
  • 2
  • What do you mean by `ng-app` isn't already set on my HTML tag? This seems like an issue with the way browsers handle loading/parsing the DOM differently, which is why adding a sleep works. You should consider manually bootstrapping your application to get consistent control over when angular initializes. – Nick Tomlin Nov 26 '15 at 14:39
  • Thank you for your response. Perhaps you were right, I hadn't the chance to test it, because the error disappeared (a month ago it was perfectly reproducible...). I have no idea what changed in my project that it works again. – MH_ Dec 04 '15 at 14:55

0 Answers0