如何根据行表中的范围文本“BG558”单击“选项”菜单。有很多行。请一些人帮我使用量角器
<tr class="ng-scope" ng-style="styleForDownLineActivities)" ng-class="ficGridAlert" bn-log-dom-creation="With" ng-repeat="baseLocationAndActivities in LocationAndActivities | baseLocationFilter:searchCriteria track by baseLocationAndActivities.baseNumber">
<td class="ng-binding" style="width : 30px"></td>
<td class="ng-binding" style="width : 30px">24</td>
<td style="width : 49px">
<tlr-station-c>
<span class="ng-binding ficSmartMenu" fic:circ7="baseLocationAndActivities.systemC" ng-class="ficSmartMenu" ng-show="editCriteria">BG558</span> <!-- Based on this text -->
<div class="ng-hide" ng-show="editCriteria">
</tlr-station-c>
</td>
<td style="width : 102px">
<td class="ng-binding" style="width : 30px">UT</td>
<td style="width : 30px">
<td style="width : 30px">
<td style="width : 25px">
<td style="width : 25px">
<td style="width : 25px">
<td style="width : 25px">
<td style="width : 25px">
<td style="width : 25px">
<td style="width : 25px">
<td style="width : 75px">
<td style="width : 75px">
<td style="width : 75px">
<td align="center" style="width : 65px">
<span class="ficSmartMenu ng-scope" ng-if="(!baseEditableMode && !baseCEditMode && FSNNum < 0)">
Options <!-- I should able to click this element -->
</span>
</td>
答案 0 :(得分:0)
我得到了解决方案。我使用了xpath
element(by.xpath("//span[contains(.,'BG558')]/following::span[contains(.,'Options')][1]").click();