【软件自动化测试-QTP实战技能 22】== QTP_DP_for the DeskTop objects
2010-11-22 14:28
691 查看
1:
eg:
For example, this will input all the text fields within a gaven page:
Dim oDesc
Set oDesc = Description.Create
oDesc("micclass").Value = "WebEdit"
Dim oChildren
Dim i
Set oChildren = Browser("index:=0").Page("index:=0").ChildObjects(oDesc)
For i = 0 to oChildren.Count - 1
oChildren.Item(i).Set "input value"
Next
2:
eg:
The .ChildObjects command can be combined with the Desktop object. to run through all the top-level
windows and applications.
For example, this will hightlight every opened Notepad window.
Dim oDesc
Set oDesc = Description.Create
oDesc("nativeclass").Value = "Notepad"
Dim oChildren
Dim i
Set oChildren =Desktop.ChildObjects(oDesc)
For i = 0 to oChildren.Count - 1
oChildren.HighLight
Next
eg:
For example, this will input all the text fields within a gaven page:
Dim oDesc
Set oDesc = Description.Create
oDesc("micclass").Value = "WebEdit"
Dim oChildren
Dim i
Set oChildren = Browser("index:=0").Page("index:=0").ChildObjects(oDesc)
For i = 0 to oChildren.Count - 1
oChildren.Item(i).Set "input value"
Next
2:
eg:
The .ChildObjects command can be combined with the Desktop object. to run through all the top-level
windows and applications.
For example, this will hightlight every opened Notepad window.
Dim oDesc
Set oDesc = Description.Create
oDesc("nativeclass").Value = "Notepad"
Dim oChildren
Dim i
Set oChildren =Desktop.ChildObjects(oDesc)
For i = 0 to oChildren.Count - 1
oChildren.HighLight
Next
相关文章推荐
- 【软件自动化测试-QTP实战技能 24】== QTP Code_ Useing Description Objects
- 【软件自动化测试-QTP实战技能 11】== QTP code for excel link
- 【软件自动化测试-QTP实战技能 23】== QTP 常用Functions
- 【软件自动化测试-QTP实战技能 17】== QTP_Compare local sheet values with run time data table values
- 【软件自动化测试-QTP实战技能 20】== QTP_ Delete files from Temp Folder:删除Folder
- 【软件自动化测试-QTP实战技能 2】== Test Object Model
- 【软件自动化测试-QTP实战技能 14】== 自动化测试思想之QTP登录脚本
- 【软件自动化测试-QTP实战技能 4】== 取得Excel中的单元格值并作比较
- 【软件自动化测试-QTP实战技能 9】== 从外部excel中读出数据导入到qtp的data中
- 【软件自动化测试-QTP实战技能 21】== QTP_use RegExp 匹配numbers
- 【软件自动化测试-QTP实战技能 25】== QTP_DataTable
- 【软件自动化测试-QTP实战技能 28】== Minimize QTP
- 【软件自动化测试-QTP实战技能 15】== QTP compare each iteration to enditeration
- 【软件自动化测试-QTP实战技能 19】== 关闭 MESSAGE BOX 当关闭EXCEL 时
- 【软件自动化测试-QTP实战技能 10】== Reporter.ReportEvent micDone
- 【软件自动化测试-QTP实战技能 28】== QTP_VbsTraining:Array Basics
- 【软件自动化测试-QTP实战技能 1】== 使用技巧实例
- 【软件自动化测试-QTP实战技能 12】== QTP 返回磁盘 freeSpace
- 【软件自动化测试-QTP实战技能 16】==QTP_调用外部EXCEL数据替换DataTable中的数据
- 【软件自动化测试-QTP实战技能 26】== QTP_Training:Environment Variables