对产品质量来说,不是100分就是0分

childobjects方法

上一篇 / 下一篇  2007-03-05 23:59:24 / 天气: 冷 / 心情: 高兴 / 个人分类:QTP

rX0C(Fvb,C0childobjects方法51Testing软件测试网? A;tamk

51Testing软件测试网9Jd#ON}1K\c/d

object.ChildObjects (pDescrīption)51Testing软件测试网tuw)Okz9W5@4b)?*?
利用该方法可以根据具体的描述取子对象。

Rt1f@R'q6~f051Testing软件测试网NkJW2]'s-K

描述:
$Z:SAaO$a0object: A test object of type WinObject.51Testing软件测试网*R]4pu*wa9es
pDescrīption: Required. An Object object.A Properties (collection) object.51Testing软件测试网4Z ~ Q} d
pDescrīption是对子对象描述信息的集合。

8_m RS1Yn&QN0

eu(c1E1]/b/^W"n u051Testing软件测试网}B2g}F/V |jM
例子:51Testing软件测试网f ^&E1R@6[4n7Kr

51Testing软件测试网$l9z1I|5f_k+L1@

'定义子对象描述信息
sZ)z T [9s I b0Set Mydes=Descrīption.Create()
psI9g/V-~ij0Mydes("attached text").value="Name:"
}!e(k~ H0Mydes("nativeclass").value="Edit"51Testing软件测试网X C/_6HB"bB-@A K|~

51Testing软件测试网*G E ~)g+\2n1H#\5_G7D

'取出页面上所有的符合描述信息的对象51Testing软件测试网mpWK#L"M7xL)Z
Set winedites=Window("Flight Reservation").ChildObjects(Mydes)51Testing软件测试网.V p\|-a#D?qasP
'选中51Testing软件测试网+|bF N1u~.h.I
NoOfChildObjs =winedites.Count51Testing软件测试网{(?6W-l Uv[%P
For Counter=0 to NoOfChildObjs-151Testing软件测试网#HM5E,I;f'C6F
  if(Counter=0) then
v'k.m$X#n0    winedites(Counter).Set "ON"51Testing软件测试网Zu1w:s5t)B0Xd
  end if
vHu(`7U)a0Next
,W'g#E\6hnV p0

9H#ip:D"p3{0{0
相关阅读:

TAG: QTP Object childobjects

 

评分:0

我来说两句

Open Toolbar