【软件测试自动化-QTP NOTE 7】 == 描述性编程(Descriptive Programming)-3rd ==
2010-07-19 00:02
337 查看
今天这篇分享同样是针对DP的,当然会通过和OR对比的方式进行分析和阐述
1.首先以Google的搜索栏为例
这是两者最普通的表现方式
对于DP,包括其属性和对应值。相反OR只是显示了其对象的逻辑描述。
2.当然这两种对于对象的定位和控制方式是不同的,我们不能以DP的方式定义父对象,然后用OR描述子对象:
3. 然而,一个OR父对象可以识别DP和OR作为子对象
4.从性能角度对比,DP的性能会比OR略逊一筹
1.首先以Google的搜索栏为例
'OR Browser( "Google" ).Page( "Google" ).WebEdit( "q" ).Set "hello world" 'DP Browser( "title:=Google" ).Page( "title:=Google" ).WebEdit( "name:=q" ).Set "hello world"
这是两者最普通的表现方式
对于DP,包括其属性和对应值。相反OR只是显示了其对象的逻辑描述。
2.当然这两种对于对象的定位和控制方式是不同的,我们不能以DP的方式定义父对象,然后用OR描述子对象:
'报错:Browser是DP,而Page和WebEdit是OR Browser( "title:=Google" ).Page( "Google" ).WebEdit( "q" ).Set "hello world" '报错:Browser和Page是DP,而WebEdit是OR Browser( "title:=Google" ).Page( "title:=Google" ).WebEdit( "q" ).Set "hello world"
3. 然而,一个OR父对象可以识别DP和OR作为子对象
'Browser是OR,Page和WebEdit是DP Browser( "Google" ).Page( "title:=Google" ).WebEdit( "name:=q" ).Set "hello world" 'Browser和Page是OR,WebEdit是DP Browser( "Google" ).Page( "Google" ).WebEdit( "name:=q" ).Set "Google hello world"
4.从性能角度对比,DP的性能会比OR略逊一筹
'OR: 9.74 秒 For i = 0 to 99 Browser("Google").Page("Google").WebEdit("q").Set "hello world" Next 'DP: 14.64 秒 For i = 0 to 99 Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Set "hello world" Next
相关文章推荐
- 【软件测试自动化-QTP NOTE 8】 == 描述性编程(Descriptive Programming)-Finial ==
- 【软件测试自动化-QTP NOTE 6】 == 描述性编程(Descriptive Programming)-2nd ==
- 【软件测试自动化-QTP NOTE 5】 == 描述性编程(Descriptive Programming)-1st ==
- 【软件测试自动化-QTP系列讲座 22】 == 描述性编程 ==
- 【软件测试自动化-QTP系列讲座 22】 == 描述性编程 ==
- 【软件测试自动化-QTP NOTE 12】 == Web Services-Final==
- 【软件测试自动化-QTP NOTE 2】 ==DataTables==
- 【软件测试自动化-QTP NOTE 3】 ==VBScript 1st==
- 【软件测试自动化-QTP NOTE 11】 == Web Services-3rd==
- 【软件测试自动化-QTP NOTE 9】 == Web Services-1st ==
- 【软件测试自动化-QTP NOTE 1】 ==对象库-Object Repository==
- 【软件测试自动化-QTP NOTE 1】 ==对象库-Object Repository==
- 【软件测试自动化-QTP NOTE 10】 == Web Services-2nd==
- 【软件测试自动化-QTP NOTE 4】 ==VBScript 2nd==
- 【软件测试自动化-QTP NOTE 2】 ==DataTables==
- 【软件测试自动化-QTP NOTE 14】 == 如何创建高效的Test-Data Dictionary 2nd ==
- 【软件测试自动化-QTP NOTE 13】 == 如何创建高效的Test-Data Dictionary 1st ==
- 【软件自动化测试-QTP实战技能 6】== QTP中运行错误的捕捉和记录
- 【软件测试自动化-QTP系列讲座 41】== 强制获取文本相对坐标 ==
- 学习QTP自动化软件测试(1)