【发布时间】:2015-09-01 00:33:30
【问题描述】:
这个查询基于我之前的问题Watir-Webdriver - Unable to locate a button with id, name, text, value,我得到了一些关于如何通过元素获取字段的详细信息。但是现在在我的一个屏幕中,我有两个具有相同类和 div 的按钮。所以我不能拿我需要的那个。我需要获得具有“检查和储蓄”产品的按钮。有人可以帮助如何获得准确的按钮点击吗?我的 Web 应用程序是在 AnjularJS 上开发的。
这是标识按钮的页面中 HTML 的完整 div 部分。
<div class="jl-layout">
<div class="jl-layout-50-50">
<!-- ngRepeat: entry in ctrl.vm.productSuites.entries -->
<div style="" ng-repeat="entry in ctrl.vm.productSuites.entries" class="item product-container centered ng-scope">
<h3 class="ng-binding">Checking and Savings</h3>
<button type="button" tabindex="0" ng-click="ctrl.submitProductSelection(entry)" class="extra-button-padding secondary jl-button">
<ng-transclude>
<span class="ng-scope">Select</span>
</ng-transclude>
</button>
<div tabindex="0" role="button" ng-click="ctrl.submitProductSelection(entry)" class="mobile-click"/>
</div>
<!-- end ngRepeat: entry in ctrl.vm.productSuites.entries -->
<div style="" ng-repeat="entry in ctrl.vm.productSuites.entries" class="item product-container centered ng-scope">
<h3 class="ng-binding">Savings</h3>
<button type="button" tabindex="0" ng-click="ctrl.submitProductSelection(entry)" class="extra-button-padding secondary jl-button">
<ng-transclude>
<span class="ng-scope">Select</span>
</ng-transclude>
</button>
<div tabindex="0" role="button" ng-click="ctrl.submitProductSelection(entry)" class="mobile-click"/>
</div>
<!-- end ngRepeat: entry in ctrl.vm.productSuites.entries -->
</div>
</div>
【问题讨论】:
标签: ruby watir-webdriver