你怎么写你的QTP测试? [英] How do you write your QTP Tests?

查看:160
本文介绍了你怎么写你的QTP测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用QTP一些web应用程序UI自动化测试实验,我想知道人们通常怎么写自己的QTP测试。你使用的对象映射,描述编程中,组合或其他方式一起?任何一个小code例子是AP preciated,谢谢

I am experimenting with using QTP for some webapp ui automation testing and I was wondering how people usually write their QTP tests. Do you use the object map, descriptive programming, a combination or some other way all together? Any little code example would be appreciated, Thank you

推荐答案

下面是我的建议。

1)建立你的测试自动化需求矩阵。
您可以使用样本从我的博客

1) Build your test automation requirements matrix. You can use samples from my blog

<一个href=\"http://automation-beyond.com/2009/06/06/qa-test-automation-requirements-usability/\">http://automation-beyond.com/2009/06/06/qa-test-automation-requirements-usability/

<一个href=\"http://automation-beyond.com/2009/06/07/qa-test-automation-requirements-usability-2/\">http://automation-beyond.com/2009/06/07/qa-test-automation-requirements-usability-2/

<一个href=\"http://automation-beyond.com/2009/06/10/qa-test-automation-requirements-5-maintainability/\">http://automation-beyond.com/2009/06/10/qa-test-automation-requirements-5-maintainability/

<一个href=\"http://automation-beyond.com/2009/06/08/qa-test-automation-requirements-robustness/\">http://automation-beyond.com/2009/06/08/qa-test-automation-requirements-robustness/

<一个href=\"http://automation-beyond.com/2009/06/09/qa-test-automation-requirements-scalability/\">http://automation-beyond.com/2009/06/09/qa-test-automation-requirements-scalability/

2)选择

3)根据您选择的方法写你的测试脚本

3) Write your testing scripts according to the approach you chose

注意 QTP资源库的方式或描述编程属于GUI前端功能测试自动化的识别部分。他们不管在鲁棒性和维护方面。
从技术上讲,它几乎是相同的。在这两种情况下,你应该明白GUI认可的概念很好,否则你将有问题不管的做法。

Note. QTP Repository way or Descriptive Programming belong to GUI recognition part of front-end functional test automation. They matter in terms of robustness and maintenance. Technically, it's nearly the same. In both cases you should understand GUI recognition concept well, or you will have problems no matter the approach.


  • 您可以像XML的数据结构存储GUI对象识别属性和记录映射到一个类似于英语的名称。每当原始对象的属性发生改变,您更新的资料库记录,而code仍然指向映射名称。

  • 或者你也可以直接把相同的识别特性成为一个函数调用处理GUI对象。每当原始对象的属性改变,你必须做code修改。但是你没有保持额外的文件与脚本一起。

一个很好的框架应该由对象引用级别运行支持GUI的映射和描述编程符号。即你应该保持物体识别和对象交互任务是分开的。

A good framework should support both GUI-mapped and descriptive programming notations by operating at object reference level. I.e. you should keep object recognition and object interaction tasks separate.

请注意,根据上下文描述编程符号可 放缓 的脚本性能和它的 总是 的要求额外维护工作,同时使用对象存储库等情况下,只有可能导致对象的描述的不必要的重复或可能限制识别动态变化的图形用户界面。结果
我说明了下面的文章中做上述的一些要点:
小QTP性能测试:对象仓库与描述编程

Note that depending on context Descriptive Programming notation may slowdown performance of your scripts and it always demands extra maintenance effort while in other cases using Object Repositories only may lead to unwanted duplication of objects' descriptions or it may limit recognition of dynamically changing GUI.
I illustrate some points made above in the following article: A little QTP performance test: Object Repository vs. Descriptive Programming

我直code例子(对于实用的自动化建议 GUI功能包装)。

Straight code examples (for a practical automation I recommend GUI Function Wrapping).

描述编程 - 通过物理描述性解决对象

Descriptive programming - addressing objects by physical description properties.

Dim sProfile
sProfile = "Guest"

Set objWebParent = Browser("title:=Select Profile").Page("title:=Select Profile")
Set objWebObject = objWebParent.Link("text:="&sProfile) 
boolRC = objWebObject.Exist(0) 
If Not boolRC Then
'error-handling
End If
objWebObject.Click

通过映射GUI名称寻址对象

Addressing objects by mapped GUI names

Browser("Select Profile").Page("Select Profile").Link("Guest").Click

感谢你,结果
阿尔伯特Gareev结果
http://automation-beyond.com/

这篇关于你怎么写你的QTP测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆