|
objVar是传入的对象(set a = browser().pager().frame().webtable())
iC是传入的列表的列的数量
strFindTitle是列表中列的标题
strFindString是列表中能确定是你要查找的字段
Public function OpenDataFun(objVar,iC,strFindTitle,strFindString)
Dim strTableTitle,iDataNum,strDesc,i,s,m,strCellData,strCellLink
Set strDesc = description.Create()
strDesc("html tag").value = "td"
set strCellData = objVar.ChildObjects(strDesc)
iDataNum = strCellData.count()
'确认查找字段所在的列
For i = 1 to iC
strTableTitle = objVar.GetCellData(1,i)
If strTableTitle = strFindTitle Then
s = i-1
End If
Next
'在确定的列中查找字符
For m = s to iDataNum step iC
strCellLink = Trim(strCellData(m).GetROProperty("innertext"))
If strCellLink = strFindString Then
strCellData(m).click
wait 2
End If
Next
End Function |
|