摘要: 完全匹配查找,即所查找的列必须与关键字的字段一致,如果某一行不一致,则退出fail
For i=2 to totalRowNumber
获取某列的值
text1=Browser(" ").Page(" ").Frame("name:=RightBottomFrame").WebTa ...
完全匹配查找,即所查找的列必须与关键字的字段一致,如果某一行不一致,则退出fail
|
For i=2 to totalRowNumber
获取某列的值
text1=Browser(" ").Page(" ").Frame("name:=RightBottomFrame").WebTable("class:=CommonTable CommonSubTable BugMode").GetCellData(i,2)
如果没有trim()方法,老是报错,不晓得为啥子,仔细看text1里面也没有空格
If trim(text1)=trim(checkTest1) Then
check=true
else
check=false
i=totalRowNumber
End If
Next
模糊查找,使用qtp自带函数RegExpTest(),经试验这里的检查作用相当于模糊查询了,不需要自己再构造正则表达式,只要存在checkTest2则返回,否则为空
For j=2 to totalRowNumber
获取某列的值
text2=Browser(" ").Page(" ").Frame("name:=RightBottomFrame").WebTable("class:=CommonTable CommonSubTable BugMode").GetCellData(j,3)
If RegExpTest(checkTest2,text2)<>"" Then
check=true
else
check=false
i=totalRowNumber
end if
Next
If check=true Then
CloseMsgByTime "pass"
else
CloseMsgByTime "fail"
End If
Browser(" ").Page(" ").Sync
Browser(" ").CloseAllTabs
版权声明:本文出自qwen的51Testing软件测试博客,欢迎转载......