【问题标题】:Unable to click on "New Application or Top Up" Text present inside <td> tag in watir/ruby无法单击 watir/ruby 中 <td> 标记内的“新应用程序或充值”文本
【发布时间】:2017-12-07 13:07:11
【问题描述】:

我正在尝试单击&lt;td&gt; 标签内的“新应用程序或充值”文本:

<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>

【问题讨论】:

  • 您能否更好地解释一下您的情况,我看到您添加了 watir 标签。您是否尝试单击测试中的元素?到目前为止,您尝试过什么?

标签: ruby watir watir-classic


【解决方案1】:

Watir 允许使用 :text 参数匹配 StringRegExp

browser.td(text: "New Application or Top Up")

browser.td(text: /New Application/)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-04
    • 1970-01-01
    • 2014-03-26
    • 2013-11-15
    • 1970-01-01
    • 2016-10-12
    • 1970-01-01
    相关资源
    最近更新 更多