QTP10安装文件夹里BTPresources自带的函数库

上一篇 / 下一篇  2011-01-05 23:55:22 / 个人分类:QTP/UFT

51Testing软件测试网$U9aUN%]G@

虽然函数库只是把QTP本身的函数封装了下,比较简单,但还是比较有用的51Testing软件测试网w1tl+dfg'\9k3@
比如verify开头的函数,封装了写报告的函数步骤,在脚本里我们只需要实现流程的控制即可51Testing软件测试网!T2ji+e:I!O"N:p V R
以下代码使用了几个其中的函数,可直接复制至QTP运行51Testing软件测试网@W+YFK*N%Hr

n6HrU'X:}eJ0openapp "iexplore.exe"51Testing软件测试网FK-r1F-~
Browser("CreationTime:=0").Navigate "http://www.baidu.com"
y,]p4YZ o)j!A$qW9X5J0Browser("CreationTime:=0").Sync51Testing软件测试网!R2f'b+_6vw Pl
If Browser("CreationTime:=0").VerifyProperty ("title","百度一下,你就知道")  then51Testing软件测试网.O5\1@ b0c{URv^
  If Browser("title:=百度一下,你就知道").Page("title:=百度一下,你就知道").WebEdit("name:=wd").VerifyDisabled then
"zfF+l*g5X U;p%W%b0      Browser("title:=百度一下,你就知道").Page("title:=百度一下,你就知道").WebEdit("name:=wd").Set "test"51Testing软件测试网8DPf2b R,U
     If  Browser("title:=百度一下,你就知道").Page("title:=百度一下,你就知道").webbutton("name:=百度一下").VerifyDisabled Then51Testing软件测试网5q)MG-AGV
             Browser("title:=百度一下,你就知道").Page("title:=百度一下,你就知道").webbutton("name:=百度一下").Click51Testing软件测试网\M3Rw I1OII*i&I

51Testing软件测试网-WJ9O0}} ] crB

             AddToTestResults pass,"百度查询","查询成功"
8?&\o?J8m"e)O0     Else
h#t-` Z(e2W0   ExitTest
M9D.k@mC D&M0u0   End If51Testing软件测试网pKmFE+K
  Else
I([:D ]^1] }0j R0       ExitTest51Testing软件测试网vs4o L0F8Acs m
  End if51Testing软件测试网#cr.P's*S'x)};Y
Else
oOGOa0 ExitTest
"W KgQp AP0End If51Testing软件测试网)oK\,kzMDWK


TAG:

 

评分:0

我来说两句

Open Toolbar