如何点击Protractor中按钮上的ui-sref设置?

时间:2017-08-21 11:35:51

标签: protractor

<button class="button button-clear button-stable link" type="button" ui-sref="login">Login</button>

var link =  element(by.css('[ui-sref="login"]'));
link.click();

通过错误,

Failed: unknown error: Element <button class="button button-clear button-stable link ng-binding" type="button" ui-sref="login" href="#/login">...</button> is not clickable at point (179, 559). Other element would receive the click: <div class="loading-container visible active">...</div>

1 个答案:

答案 0 :(得分:0)

根据错误消息,有一个装载容器在单击时悬停元素。假设这个加载容器是一个临时的东西,你应该能够通过添加额外的显式等待使其工作,这将等待&#34;可点击性&#34;要素:

mvn clean test -Dgroups=first,second