QTP 常用的函数2
上一篇 /
下一篇 2009-02-27 15:48:15
/ 个人分类:qtp
1.GetCellData函数
51Testing软件测试网v Fe)HZR8en 作用:获取单元格的值
-F;^2O+~8u%}051Testing软件测试网LSl[A P 例:
rowCount = Browser("xxx ").Page("xxx ").Frame("xxx").WebTable("xxx").RowCount51Testing软件测试网&l!aPJy,S%km?"e For counter = 1 To rowCount51Testing软件测试网!W%N!N8\)d!E-[1J text = Browser("xxx").Page("xxx").Frame("xxx").WebTable("xxx").GetCellData(counter,1)51Testing软件测试网r1G6zT3vm"z If (text = "xxx") Then51Testing软件测试网dOC.I{ tH;~.Y WD,r counter = counter - 151Testing软件测试网({RA`%b'jkF selectNO = "#" & counter 6P!eJ2p4f(Z^0 Browser("xxx").Page("xxx").Frame("xxx").WebRadioGroup("xxx").Select selectNO )F2]$w?q^0 Exit For51Testing软件测试网%q%^$CS2~ z2~id;[ End If #v2J'`&iF0Next |
1O1\6Rf5VE Z(a0^*xkRU2A/[0 2.把值插入datatable里51Testing软件测试网
H^4G5Z"Ne xS
51Testing软件测试网$X_&s/YOYKu W 例:
datatable.setcurrentrow(i) #G-r+Mp [n?M0 datatable.value("name","Global")="name" :rQ@9E5p%m3_%S"^0 datatable.value("passwd","Global")="passwd" |
/Y8`4`)h4[H9R0:yr${O+Ebto$p0 3.用代码来启动浏览器
Browser1 = "IE"51Testing软件测试网2~ [WG6b)Ogx
R StartURL = "www.51testing.com"
Ma4@!pDY
H
r/}0 IF Browser1 = "IE" THEN 8R;ZxV5q0 set IE = CreateObject("InternetExplorer.Application") x
]f] C0 IE.Visible = true v"\(J7qN3f0 IE.Navigate StartURL51Testing软件测试网S:Y3ugw W END IF |