It seems when protractor execute "browser.driver.get(...)" it waits until page is loaded or throw "Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL
" message. Remote url is 1 to 10 times fail to load (following by freeze). A workaround for that is to refresh/reload page. Is there any way to implement that behaviour in Protractor? (let say repeat action 4-8 times and then continue)
Asked
Active
Viewed 899 times
2

Victor.Palyvoda
- 523
- 3
- 12
1 Answers
-1
You should be able to catch errors thrown through the promises api, like this:
browser.driver.get(...).then(function(result) {
// do something when page is found
}.thenCatch(function(error) {
// do something with the error
});

Andrew Eisenberg
- 28,387
- 9
- 92
- 148
-
It prints {[[PromiseStatus]]: "pending" } has no method 'catch' – Victor.Palyvoda Jun 18 '15 at 17:52
-
Oops. I think the correct method is `thenCatch`. Changed the answer. – Andrew Eisenberg Jun 19 '15 at 21:04
-
I'm still getting error: "Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL" and then protractor exists. Callback on "thenCatch" never calls. – Victor.Palyvoda Jun 20 '15 at 23:41