Protractor tests failing in second run for ng-reflect attribute

时光怂恿深爱的人放手 提交于 2019-12-06 21:09:26

Since ng-reflect-* are there for debugging purposes, I would not rely locators on them.

I suspect the function that adds ng-reflect-* attributes does not necessarily perform before Angular confirms "readiness" to Protractor (every Protractor "command" goes through a sync with Angular). In other words, at the time you search for your input, ng-reflect-name is not yet set on the element.

If you are still going to continue using ng-reflect-* attributes, try adding an Explicit Wait to wait for the element to become present:

var EC = protractor.ExpectedConditions;
var emailInput = element(by.css('[ng-reflect-name=email]'));
browser.wait(EC.presenceOf(emailInput), 5000);

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