Click into an icon isn't working on protractor

亡梦爱人 提交于 2019-12-08 12:02:07

问题


I have an icon to add a new item, i want to click into it but the action isn't done. I don't know if i'm locating the element in a right way ?

I have tried the answer provided in that Question :

element(by.css('[ng-click="createWL()"]')).click();

element(by.css("button[ng-click*=createWL]")).click();

But it didn't work for me.

Here my html code : <button class="md-icon-button watchlist-icon-button md-button md-ink-ripple" type="button" ng-transclude="" id="addWL" aria-label="Add Watchlist" ng-click="createWL()"> <ng-md-icon icon="add_circle_outline" class="ng-scope">


回答1:


The problem was that this test is executed before it's time so that it's failed and we didn't even see that icon in the screen.

So fix it with some wait ;) and test priority.



来源:https://stackoverflow.com/questions/37225676/click-into-an-icon-isnt-working-on-protractor

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