我正在尝试点击<td>
标记内的“新应用程序或充值”文本:
<button class="BIMG" tabindex="-1" id="T979" name="T979"style="border:0;background-color:transparent;left:14px;top:114px;width:193px;height`enter code here`:23px;z-index:2020; clip:rect(0px 193px 23px 0px);color:#28497b;">
<table class="T" style="top: 4px; left: 10px; width: 183px; height: 19px; font-weight: bold; font-size: 12px; font-family: Arial; color: rgb(40, 73, 123); text-decoration: underline;" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="vertical-align:top;text-align:left;">New Application or Top Up</td>
</tr>
</tbody>
</table>
</button>
答案 0 :(得分:1)
Watir允许String
&amp;使用RegExp
参数匹配:text
:
browser.td(text: "New Application or Top Up")
browser.td(text: /New Application/)