angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Failed: Error while waiting for Protractor to sync with the page: "window.angular is undefined. #2854

Closed brobee closed 8 years ago

brobee commented 8 years ago

Hi,

I've just started to use Protractor. I created several page objects and everything is working fine till now. I log in to a page and I'm being redirected to the myaccount page.

On that page, I got the following error: Error while waiting for Protractor to sync with the page: "window.angular is undefined.

My code is here:

var myaccount = function(){

//some function but everything is commented out }; module.exports = new myaccount(); Here is my login test as well:

this.loginSuccess = function(){
userName.sendKeys(params.registration.email);
password.sendKeys(params.registration.password);
submitButton.click();

}; After the click, myaccount page appears but the protractor throws the mentioned error.

It seems, the myaccount page is not angularjs, there is no ng-app or other angular related stuff. I've found several topic in this question, but in this case, the rootElement config does not help for me.

How can I handle this situation?

Could somebody help me with this? Thank you in advance!

juliemr commented 8 years ago

Please direct general support questions like this one to an appropriate support channel, see https://github.com/angular/protractor/blob/master/CONTRIBUTING.md#questions

Thank you!

Quick answer - you need to use browser.driver or ignoreSynchronization to work on a non-angular page.

juliemr commented 8 years ago

See also https://github.com/angular/protractor/blob/master/docs/faq.md#how-do-i-deal-with-my-log-in-page

brobee commented 8 years ago

Hi Julie, thanks. I've tried it. The main problem is that, within an it() testcase, I start a non angular page but after one click, I redirected to an angular page and I got this error: Failed: unknown error: angular is not defined. Can I handle both cases in one testcase? (Nothing special, login, myaccount, search forms where the login and search is angular and my account is non angular) Strange situation!

reddynr commented 8 years ago

I am getting below error. can anybody help much appreciated. Thanks

Failed: Error while waiting for Protractor to sync with the page: "[ng:test]