Timed out waiting for Protractor to synchronize with the page after 11 seconds - Protractor

◇◆丶佛笑我妖孽 提交于 2019-12-08 09:06:59

问题


I have a login form, and I want to set input to both inputs, but the test doesn't go through in Chrome, Safari, but with Firefox it works.

Initially I have a $http request and it is done, and as I know, protractor continues when $http is done, so this should not be the issue, or is it?

Error:

Uncaught exception: Timed out waiting for Protractor to synchronise with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md

This is my test:

describe('ADM login page', function () {
	beforeEach(function () {
		browser.get('http://127.0.0.1:8383/v2');
	});

	it('login', function () {
		var username = element(by.css('div.e2e-adm-username-input input.Input-Holder')),
			password = element(by.css('div.e2e-adm-password-input input.Input-Holder'));

		username.sendKeys('test');
		expect(username.getText()).toBe('test');

		password.click();

		password.sendKeys(',,test');
		expect(password.getText()).toBe(',,test');

		element(by.css('div.Login-ActionHolder a.Big-Action')).click();
	});
});

回答1:


you could add allScriptsTimeout: milliseconds in protractor configuration file. I was having a $http request in the background that was taking too long.

exports.config = {
    ...
    allScriptsTimeout: 50000,
    ...
};


来源:https://stackoverflow.com/questions/30030867/timed-out-waiting-for-protractor-to-synchronize-with-the-page-after-11-seconds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!