51Testing软件测试论坛

标题: 知道的进来看一下 如何获取子对象的类型 [打印本页]

作者: dinglingxdd    时间: 2009-11-23 11:01
标题: 知道的进来看一下 如何获取子对象的类型
Dim oDesc ,children
Set oDesc = Description.Create()
Set children = Window("TBAudit").Dialog("Metric Design").Dialog("Add/Delete Element").WinListView("Modified Property:").ChildObjects(oDesc)
我如何获取子对象的类型(是属于哪个类,winobject、winlist等等)。实际从界面上来看这个父对象是包含CheckBox类型的,但是我怎么确切知道是不是含有这个类型呢?或者谁知道children下面有哪些方法和属性,麻烦告诉我一下。我目前只知道有count方法,其他的都不知道,所以无从下手

[ 本帖最后由 dinglingxdd 于 2009-12-7 13:28 编辑 ]
作者: dinglingxdd    时间: 2009-11-23 11:02
标题:
自己顶!
作者: deting    时间: 2009-11-23 11:20
maybe you can achieve all the components from the childs and compare the specify one.
obj1  =   Description.Create()
obj1("attribute").value="XXXXX"
Set children = Window("TBAudit").Dialog("Metric Design").Dialog("Add/Delete Element").WinListView("Modified Property:").ChildObjects(oDesc)
item_count = children.length
Do i > item_count
  if obj1.existes then
    .......................
  end if
loop
作者: dinglingxdd    时间: 2009-11-23 13:37
标题: 回复 deting
楼上说的这种方法不行,有没有其他方式?
作者: dinglingxdd    时间: 2009-11-23 15:07
标题: 没有人知道吗?在线等
555...
怎么没人知道啊
作者: dinglingxdd    时间: 2009-11-23 17:47
标题: 没人知道
还是没有人知道
作者: dinglingxdd    时间: 2009-11-24 11:43
标题: :lol
问题已解决。这种带有checkbox的winlistview控件,其子对象只有一个就是本身,通过子对象无法获取checkbox。但是可以通过winlistview的GetItemProperty方法,获取state,被选中的返回2,不被选中的返回1。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2