【发布时间】:2019-02-08 13:58:49
【问题描述】:
在我的网络应用程序中,我试图在表格的单元格中选择一个按钮。
并非每个单元格都包含显示详细信息按钮,并且该按钮仅根据该单元格中的文本显示
截图如下
<td>
Allocated
<button ng-show="row.entitlementId" id="btnShowDetails" class="btn btn-primary btn-sm" style="width: 110px; float:right;" ng-click="showAllocationMonetaryDetails(row.entitlementId, CisBusinessID);" title="Show Details">
<span class="glyphicon glyphicon-search"></span>Show Details
</button>
<br>
<div style="font-size: small; color: darkgreen" ng-show="row.manualEstablishCommandType >= 0">
Adjustment
</div>
<div style="font-size: small; color: darkgreen" ng-show="row.manualReclaimCommandType >= 0">
</div>
</td>
我尝试使用以下 xpath 来定位显示详细信息按钮,但它不起作用。
("//td[contains(.,'Allocated') and (contains(@id,'btnShowDetails'))]")
有人知道如何选择“显示详细信息”按钮吗?
谢谢
【问题讨论】: