<ul class="nav nav-pills" ng-class="{'nav-stacked': vertical, 'nav-justified': justified}" ng-transclude="">
<li ng-class="[{active: active, disabled: disabled}, classes]"
class="uib-tab nav-item ng-scope ng-isolate-scope
active"index="0" select="vm.setTab('overview')">
<a href="" ng-click="select($event)" class="nav-link ng-binding" uib-tab-heading-transclude="">
<uib-tab-heading class="text-center ng-scope">
<span class="text-overflow">Overview</span>
</uib-tab-heading>
</a>
</li>
<li ng-class="[{active: active, disabled: disabled}, classes]"
class="uib-tab nav-item ng-scope ng-isolate-scope" index="1"
select="vm.setTab('jobListing')">
<a href="" ng-click="select($event)" class="nav-link ng-binding" uib-tab-heading-transclude="">
<uib-tab-heading class="text-center ng-scope">
<span class="text-overflow">Job Listing</span>
</uib-tab-heading>
</a>
</li>
</ul>
以上是自动生成的html代码。我想使用量角器点击“工作列表”,因为我尝试了下面的东西,但是没有用。请帮忙。
$('li[select="vm.setTab(\'jobListing\']"').click()
答案 0 :(得分:1)
试试这个:
element(by.cssContainingText('.nav .nav-item', 'Job Listing')).click();