csdn博客:http://blog.csdn.net/qwentest

qtp之重置

上一篇 / 下一篇  2010-05-04 11:47:49 / 个人分类:Bug那些事儿

NGSxj$gC8C2@/u0SystemUtil.Run "iexplore.exe","","C:\Documents and Settings\xxxx\桌面",""51Testing软件测试网$jK+mL;p0G i#S
Browser("Browser").Page("Page").Sync51Testing软件测试网+Fs0fyTuJ
Browser("Browser").Navigate "http://local/test/"

_-I_2L2k4F6Y:] c051Testing软件测试网yP5| a tgmZ]

Browser("Browser").Page("login").WebEdit("name").Set "afafa"
9czIA O kB;\0Browser("Browser").Page("login").WebEdit("password").SetSecure "1234"51Testing软件测试网vv&^ E m0Y B\
Browser("Browser").Page("login").WebButton("登录").Click51Testing软件测试网 HC4z8P6uN`"oAi
wait (1)'需要停顿1秒,不然qtp不会记录重置操作

3C9e5O5d:w%QLv051Testing软件测试网[q&AG E%\3X']Y

Browser("Browser").Page("login").WebButton("重置").Click

lX+P#XS"|g*y f051Testing软件测试网8hW!D+I"d {qy@

 '!!!!!!!!!!!!!!!!!!!!!!!!!!end 录制代码!!!!!!!!!!!!!!!!!!!!!!!
Nl8F9G7p5s2v0lname=Browser("Browser").Page("login").WebEdit("name").GetROProperty("value")
'E@7^1d*nW&}0lpwd=Browser("Browser").Page("login").WebEdit("password").GetROProperty("value")51Testing软件测试网tg|4J;dD`*]

${z ij-Ad0other=Browser("Browser").Page("login").GetROProperty("logininfo")'div层名
_+P'^r[n]0If (lname="" and lpwd="") and ther="" Then
h6dO1~DZJ|v0 msgbox "pass"51Testing软件测试网"T p]MR$x z
 Browser("Browser").Close51Testing软件测试网R4d[1q"Fq6OU
else51Testing软件测试网UVYxD+Q:t
 msgbox "fail"51Testing软件测试网6l o\,J(@
 Browser("Browser").Close
;kl }.m6gW0End If51Testing软件测试网q6q2vE2_$t

m~*YJJ_)K051Testing软件测试网c6x p(Km c I ?Y0^ t

获取层信息使用getroproperty属性,由于qtp不能捕捉到此层,需要手动到页面中找到该div的名称51Testing软件测试网%o b9dn_ ^E \

t(e%M*|y7F2bQ7U3e K0qwen 2010-5-451Testing软件测试网OyvydG5W


TAG:

 

评分:0

我来说两句

Open Toolbar