[PLAYING QTP] Part2—Record

简介:
 PART – 02
  RECORD
  “录制”是 QTP的一个最基本的功能, 测试人员在什么都不会的情况下,通过录制,就能完成一个简单的线性测试脚本。方便,快捷。但是带来的问题是,很多人在接触自动化的时候,也就了解到了自动化是靠的“录制”而成。尤其是开发,或是不懂自动化的测试领导。瞬间你个 自动化测试人员的高大上的光环消失。(一把眼泪一把鼻涕的血泪史啊)
  OK,言归正传,录制其实能说的不多,就和录音一样,点击录制,然后进行你的测试,然后,一段脚本生成,简单快捷。但是建议大家尽量不要使用录制,尽量手动添加对象到对象库,然后拖动至专家视图,进行编辑。
   关于优缺点
   使用纯录制,会有以下,问题:
  漏步骤。对一些识别的不好的控件,QTP会显示出现无法录制的情况,后来回放失败,还得一个个查是少了哪个步骤。
  对象凌乱。如果你在一个页面上分两次录制,有可能出现 object 、object_2、object_3 的情况,其实属性都一样,其实都是一个东西,但是却记录了很多多余的分支。
  名称过长。有的网页的标题很长,录制下来的脚本会把脚本拉的很长,比如录制51testing首页的一个控件后,脚本为:Browser(“51Testing软件测试网-中国 软件测试人的精神家园”).Page(“51Testing软件测试网-中国软件测试人的精神家园”).WebElement(“今日热点”).Click
  控件不明确。有时候开发图省事,不会对每个控件做很详细的属性描述,造成脚本出现大量WebEdit1、WebEdit2、WebEdit3…… WebEdit20之类的现象,如果使用录制,你会发现你的脚本几乎没有可读性而言,必须一个个控件重新定位才能确认。
   当然了,也不是没有优点:
  简单
  支持低级录制
  综上所述,建议大家手动编写脚本。
   然后看一下关于录制的相关设置:
  在 Tools 下的 Web Event Recording Configuration 可以对录制的等级进行设置,但是只对于BS架构的系统才能产生作用。
  Basic等级下,是不会对鼠标在某对象上停留2秒的情况录制出效果的。
  在Options中还有些其他设置,根据自己的需要进行录制设置。
  在录制状态下,工具栏的这两个按钮会亮起,前者是 模拟录制 ,后者是 低级录制。
  前者录制下一堆鼠标的行动动作,并生成一句:
  CODE:
  Desktop.RunAnalog "Track1"
  后者会记录下很多的坐标,比如:
  CODE:
Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Click 1159,568
Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Click 627,205
Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Type "423"
Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Type "234234"
  OK,关于Record的东西就聊到这里,没有什么难点。
  最后来回顾一下说的几点吧:

最新内容请见作者的GitHub页:http://qaseven.github.io/

相关文章
|
8月前
|
机器学习/深度学习 数据采集 存储
Doc2EDAG: An End-to-End Document-level Framework for Chinese Financial Event Extraction论文解读
大多数现有的事件抽取(EE)方法只提取句子范围内的事件论元。然而,此类句子级事件抽取方法难以处理来自新兴应用程序(如金融、立法、卫生等)的大量文件
49 0
|
9月前
|
Windows
DTDragDropFile UE Drag the system file to the window Plug-in Description
DTDragDropFile UE Drag the system file to the window Plug-in Description
42 0
We cannot activate inspection type for article master in transaction code MM41?
We cannot activate inspection type for article master in transaction code MM41?
We cannot activate inspection type for article master in transaction code MM41?
SAP QM 执行事务代码QP01,系统报错 -Material type FOOD is not defined for task list type Q-
SAP QM 执行事务代码QP01,系统报错 -Material type FOOD is not defined for task list type Q-
SAP QM 执行事务代码QP01,系统报错 -Material type FOOD is not defined for task list type Q-
|
网络协议
SAP公司间STO里发货单过账后触发的IDoc报错 – Could not find code page for receiving system –
SAP公司间STO里发货单过账后触发的IDoc报错 – Could not find code page for receiving system –
SAP公司间STO里发货单过账后触发的IDoc报错 – Could not find code page for receiving system –
SAP QM 事务代码QPR3显示一个Physical Sample Record
SAP QM 事务代码QPR3显示一个Physical Sample Record
SAP QM 事务代码QPR3显示一个Physical Sample Record
SAP WM LPK1 不能把 cross-material control cycles定义成release order parts
SAP WM LPK1 不能把 cross-material control cycles定义成release order parts
SAP WM LPK1 不能把 cross-material control cycles定义成release order parts
[swscaler] Warning: data is not aligned! This can lead to a speedloss 的解决方法【FFmpeg】
[swscaler] Warning: data is not aligned! This can lead to a speedloss 的解决方法【FFmpeg】
622 0
[swscaler] Warning: data is not aligned! This can lead to a speedloss 的解决方法【FFmpeg】
|
Web App开发
SAP Fiori Launchpad上的错误消息 - User Parameter /UI2/WD_TRKORR_CUST is not maintained
Created by Jerry Wang, last modified on Mar 11, 2015 Issue: You meet with the following error message in Fiori UI:
134 0
SAP Fiori Launchpad上的错误消息 - User Parameter /UI2/WD_TRKORR_CUST is not maintained
2015-03-18 current note update logic in my task
2015-03-18 current note update logic in my task
72 0
2015-03-18 current note update logic in my task