Login page is non- angular. So I set browser.ignoreSynchronization = true; Then after passing the login screen, I have set browser.ignoreSynchronization = false. Also, I have used browser.refresh(). While execution, I see all the steps executed, but shows error message as timeout after 11 seconds.

  • 1
    I've never actually been able to get this to work properly. The new way of doing this is to use browser.waitForAngularEnabled() and pass in true of false accordingly. I just set mine to false in the .onPrepare(). I'm always running into the Angular couldn't be found on this page error. Especially when using webpack, so I just disable it entirely and figure out other ways of waiting for elements to be interactable. It's been too much of a hassle with unreliable results for me to keep switching back and forth. Any of the ExpectedConditions options will work perfectly fine. Sep 19 '19 at 15:02

You can use browser.ignoreSynchronization=true entirely for angular/non-angular pages and use your own wait mechanism using ExpectedConditions to handle elements.

Either way is using driver methods directly as below, so it won't wait for $http and $timeout

expect(browser.driver.findElement(by.css('.msgtext')).getText().toBe('expexted text')

Please let me know if you need more help and upvote this answer if you find it helpful

  • Thank you both. I am already handling the same way you suggested. But would like to how to get this working
    – STE
    Sep 26 '19 at 5:18
  • Also noticed, after login-in the landing page, I see iframe tag inside the body. Should I switch to iframe and check for angular enabled
    – STE
    Sep 26 '19 at 5:24
  • Yes, add browser.ignoreSynchronization=true just after switching to frame Sep 26 '19 at 9:41
  • My application is build using angular. But ng app is not set in body tag. Also I am not able to find any ng-model/ng-bind tags. All I could see is only _ ngcontent tags. In this case, is there any possibility to change to browser.rootE1 value and remove expected conditions. Will this work
    – STE
    Sep 26 '19 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.