最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to click on a ui-sref link in Protractor? - Stack Overflow

programmeradmin1浏览0评论
<li ui-sref="settings.contacts" class="ng-scope active" ui-sref-active="active">

How would I select this element in protractor? I have tried to use element(by.partialLinkText but I'm getting undefined error.

<li ui-sref="settings.contacts" class="ng-scope active" ui-sref-active="active">

How would I select this element in protractor? I have tried to use element(by.partialLinkText but I'm getting undefined error.

Share Improve this question asked Jul 17, 2014 at 14:13 Sakamoto KazumaSakamoto Kazuma 2,5797 gold badges38 silver badges77 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 6

If have another solution.

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

Works well.

You can select the ui-sref using protractor-linkuisref-locator.

Click event not work

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

It will through error,

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>
发布评论

评论列表(0)

  1. 暂无评论