如何使用量角器单击第二个li内的锚标签?

时间:2017-04-14 19:36:48

标签: angularjs protractor

<ul ng-init="ptab = 1">
    <li ng-class="{active:ptab===1}" class="active">
        <a class="info" ng-click="ptab = 1">GENERAL INFORMATION</a>
    </li>
    <li ng-class="{active:ptab===2}">
        <a class="info" ng-click="ptab = 2">SKILLS</a>
    </li>
    <li ng-class="{active:ptab===3}">
        <a class="info" ng-click="ptab = 3">PATHWAYS</a>
    </li>
</ul>

这是我的HTML。我想点击第二个名为SKILLS的Protractor,我有

$$('.profile-top ul li').get(1).click()

但我认为点击li而不是a。如何点击a

1 个答案:

答案 0 :(得分:4)

如果你想用select top 15 sort_seq, field1, field2, field3, field4 from ( select 0 as sort_seq, field1, field2, field3, field4 from myTable union select id, null, null, null, null from dummyTable ) as X order by sort_seq, field1 来做,你可以做:

css

或使用不同的定位器,如@Barney所建议的那样:

$$('.profile-top ul li a').get(1).click();