Protractor fails to find Angular Protractor fails to find Angular selenium selenium

Protractor fails to find Angular


I'm not too sure about doing a beforeEach() within a, it() but that aside, have you tried waiting a while?Obviously by this i mean either a ptor.waitForAngular() or a ptor.wait()?

Try a ptor.sleep(10000) after your ptor.get() just to see if it is a timing thing.

Edit: also take a look at the protractor api and how wait() works:

ptor.wait(function () {  // Return a condition. Code will continue to run once it is true      }, 10000); // Only do this for 10 seconds

Edit: Try ptor.driver.get('my-page'); instead of ptor.get('my-page');

Edit: Protractor now exposes browser as a global so you can just use browser.get('index.html#/foo') or browser.wait() etc.


Try including this in your test file:

browser.ignoreSynchronization = true;

It switches off your test's sync with angular and makes it work.


Are you using ng-app to bootstrap your Angular application? Or are you manually bootstrapping your application?

I see that in your configuration file that rootElement is set to 'html'.

By default protractor assumes that the root of the app will be on the body tag. If the <html> tag is not where angular bootstraps in your application, try changing the root element in the config file to where angular first bootstraps(wether it is manually or though using the ng-app directive). This really helps with timing issues, and speeds protractors execution up.