![](/img/trans.png)
[英]how to locate an id of the button to click when id is dynamic in robot framework
[英]How to click on an element in case of not unique id in Robot Framework Selenium
例如代码:
<tr class="list-surveyor-assign" data-id="xoghSatJFCJ">
<td style="width: 40%><p style="padding-bottom: 5px;">Miss Anna</p></td>
<button id="btnSelectSurveyor" title="Assign" class="btn btn-sm btn-primary" data-surveyor="xoghSatJFCJ">
<i class="fa fa-user-plus" aria-hidden="true"></i>
</button>
</tr>
<tr class="list-surveyor-assign" data-id="7G8s7AwTzkh">
<td style="width: 40%><p style="padding-bottom: 5px;">Miss Jane</p></td>
<button id="btnSelectSurveyor" title="Assign" class="btn btn-sm btn-primary" data-surveyor="7G8s7AwTzkh">
<i class="fa fa-user-plus" aria-hidden="true"></i>
</button>
如何通过data-surveyor =“ 7G8s7AwTzkh” 单击按钮 id =“ btnSelectSurveyor”
您可以使用以下两个单独的属性。
//button[@id='btnSelectSurveryor' and title='Assign']
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.