I have Protractor tests that work fine locally (directConnect: true), but when I try to run them on a remote Selenium server (Grid), I always get the following message.
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
Looking for errors, Message and Stack display the following for all my test cases:
Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. Stack: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. at Timer.listOnTimeout (timers.js:92:15)
I tried a number of things, such as increasing the jasmine timeout interval, adding earlier timeouts such as getPageTimeout and allScriptsTimeout to conf, but it still causes a jasmine timeout error. The following error is displayed in the log:
00:03:18.328 INFO - Done: [execute async script: try { return (function (rootSelector, ng12Hybrid, callback) { var el = document.querySelector(rootSelector); try { if (!ng12Hybrid && window.getAngularTestability) { window.getAngularTestability(el).whenStable(callback); return; } if (!window.angular) { throw new Error('window.angular is undefined. This could be either ' + 'because this is a non-angular page or because your test involves ' + 'client-side navigation, which can interfere with Protractor\ ' + 'bootstrapping. See http://git.io/v4gXM for details'); } if (angular.getTestability) { angular.getTestability(el).whenStable(callback); } else { if (!angular.element(el).injector()) { throw new Error('root element (' + rootSelector + ') has no injector.' + ' this may mean it is not inside ng-app.'); } angular.element(el).injector().get('$browser'). notifyWhenNoOutstandingRequests(callback); } } catch (err) { callback(err.message); } }).apply(this, arguments); } catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body, false]])
I know for sure that my application is angular and it runs successfully when launched locally. I tried setting
browser.ignoreSynchronization = true
and also set
rootElement='html#ng-app'
in conf (bc my ng-app is not in the body, but rather in the html tag). The frame is set to jasmine, although I tried jasmine2, but none of them have any meaning. On a remote server, I can start firefox, and the user interface shows me a started firefox session. However, he just sits there until a timeout occurs. Any input would be appreciated!
angularjs selenium selenium-grid selenium-rc protractor
Jason tan
source share