【问题标题】:How to verify that the current text in specific element is showed on page using Selenium IDE?如何使用 Selenium IDE 验证特定元素中的当前文本是否显示在页面上?
【发布时间】:2014-04-19 07:54:35
【问题描述】:

我有一个无法解决的问题。

谁能告诉我如何定位下一个显示的当前元素

<td style="width: 250; text-align:right" class="stData"> March 14 2014, 00:00 </td> 

是否包含“2014 年 3 月 14 日 00:00”文本?

【问题讨论】:

    标签: html selenium selenium-ide


    【解决方案1】:

    你可以试试强大的java包jsoup。一些指南是here

    【讨论】:

      【解决方案2】:

      在 Selenium IDE 中使用 verifyText、verifyNotText 方法来验证文本是否存在。

      verifyText(定位器,模式)

      Arguments:
      
          locator - an element locator
      
      Returns:
          the text of the element
      
      Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
      

      verifyNotText(定位器,模式)

      Arguments:
      
          locator - an element locator
      
      Returns:
          the text of the element
      
      Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-04-18
        • 2013-09-26
        • 2022-01-25
        • 1970-01-01
        • 1970-01-01
        • 2013-07-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多