使用VbScript检查HTML表中是否存在字符串

使用VbScript检查HTML表中是否存在字符串,vbscript,qtp,hp-uft,Vbscript,Qtp,Hp Uft,嗨,我是HPE UFT测试的新手,我想写一个VBscript。 这是我的HTML表格: <table class="table table-striped table-condensed data-table dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info"> <thead> <tr role="r

嗨,我是HPE UFT测试的新手,我想写一个VBscript。 这是我的HTML表格:

 <table class="table table-striped table-condensed data-table dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
   <thead>
      <tr role="row">
         <th tabindex="0" class="sorting" aria-controls="DataTables_Table_0" style="width: 226px;" aria-label="Name: activate to sort column ascending" rowspan="1" colspan="1">Name</th>
         <th tabindex="0" class="sorting" aria-controls="DataTables_Table_0" style="width: 481px;" aria-label="Address: activate to sort column ascending" rowspan="1" colspan="1">Address</th>
         <th tabindex="0" class="sorting" aria-controls="DataTables_Table_0" style="width: 138px;" aria-label="VAT Number: activate to sort column ascending" rowspan="1" colspan="1">VAT Number</th>
         <th class="sorting_disabled" style="width: 64px;" aria-label="&amp;nbsp;" rowspan="1" colspan="1" data-orderable="false">&nbsp;</th>
      </tr>
   </thead>
   <tbody>
      <tr class="odd" role="row">
         <td>myCompany</td>
         <td>test street, USA, WD</td>
         <td>65465465465464</td>
      </tr>
      <tr class="even" role="row">
         <td>Supplier</td>
         <td>Franklin Street, USA, NYC</td>
         <td>654564654654</td>
      </tr>
   </tbody>
</table>

名字
地址
增值税编号
我的公司
美国西部测试街
65465465465464
供应商
富兰克林街,美国,纽约
654564654654
我想写一个函数或过程来循环表并检查字符串myCompany是否存在于表体中。 如果结果列表中显示了特定的公司名称,则接受测试场景

 IntRowNum=Browser("CreationTime:=0").Page("name:=myPage").WebTable("name:=myTable").getRowWithCellText("myCompany")
如果找不到文本,IntRowNum为-1。否则将返回行号