Why must I use browser.sleep while writing protractor tests
Since there is an ignoreSynchronization
turned on, you cannot use waitForAngular()
, which would be a solution in case of an angular-site testing.
A better solution here would be to set a page load timeout:
browser.manage().timeouts().pageLoadTimeout(10000); // 10 seconds
See also these relevant threads on explicit waits and timeouts:
- Use protractor to test login on non-AngularJS page (Leo's answer is very detailed)
- Protractor : How to wait for page complete after click a button?
- Timeouts