热爱测试,主要研究性能测试和自动化测试方面的技术,希望与同样对测试有热情的你一同进步成长

QTP Delphi插件的一个BUG

上一篇 / 下一篇  2008-09-19 10:25:52 / 个人分类:功能自动化

2D!m!W&WI_5qC/d0|K0    在某个QTP+QC的银行系统的自动化测试项目中,因为交易模拟器是Delphi程序,因此用到了Delphi插件,但在调试脚本的过程中,发现了Delphi插件的一个问题,推断应该是Delphi插件的BUG.

#S7y:i y"K t qo051Testing软件测试网'X![5O8Oz,Oy#q-R

   脚本中需要对一些DelphiWindow进行是否存在的判断,51Testing软件测试网 K'wuL[$N woLT3p

51Testing软件测试网Z6Avr]? is)mf

    If DelphiWindow("xxx").Exist

P t^i[^%k051Testing软件测试网1y @Sbj#v%p+E0\F I

    QTP在执行到这段代码的时候,如果第一次执行到这种语句时这个窗口如果没有存在,QTP就会报找不到这个窗口的对象这样的错误.如果是在一个循环中,只要循环的第一次执行到这个语句的时候这个窗口存在,那以后即使窗口不存在也不会报找不到对象的错误,那这个函数本来就是判断是否存在的,判断完只给个判断结果就可以了,是不应该报错误的.同样的语句,使用Window标准组件进行对象的识别和脚本编写,51Testing软件测试网'kxc8z c@3r k2k O

V |EH uV/w?4[]/o0   If Window("xxx").Exist 执行的时候是正常的,不会报任何错误51Testing软件测试网 R+d&?G.\_ n-o K k F

51Testing软件测试网)A)q \ p&ai

   基于上面的分析,推断这是Delphi插件的一个BUG.

PE5Q)kH051Testing软件测试网Hf j)Jt2_C

 51Testing软件测试网o.e^:N0e&hO


TAG: 功能自动化

引用 删除 yeping1215   /   2010-07-21 09:26:57
请问一下,我装了QTP的delphi插件之后,为什么识别的对象依然全部是winobject的?
zibeike的个人空间 引用 删除 zibeike   /   2010-06-11 10:37:36
to li_sy:
QTP的delphi插件安装后,还需要对被测程序进行配置才能正常使用。
方法如下:
You must perform the following steps for each application that you want to test.
To link to the MicDelphiAgent.pas module:
1.        Add the <QuickTest Professional Installation folder>\dat\Extensibility\Delphi folder to your Delphi project search path or copy the contents of the <QuickTest Professional Installation folder>\dat\Extensibility\Delphi folder to your project folder.
2.        Add MicDelphiAgent to the Uses section of your application's project file (project.dpr) as shown in the example below:
program flight;
uses
       MicDelphiAgent,
       Forms,
       Windows;
($R*.RES)
begin
       Application.Initialize
       Application.Title :='Flight Reservation';
       Application.Run;
end.
3.        Compile your Delphi project.
Note: If your application includes the TwwDBGrid from InfoPower, you must add support for this grid as described in Configuring Support for TwwDBGrid.
  Configuring Support for TwwDBGrid   
If your application includes the TwwDBGrid from InfoPower, follow the following instructions to enable support for this grid.
1.        Add MicWWSupport to the Uses section of your application's project file (project.dpr) after MicDelphiAgent, as shown in the example below:
program flight;
uses
       MicDelphiAgent,
       MicWWSupport,
       Forms,
       Windows;
($R*.RES)
begin
       Application.Initialize
       Application.Title :='Flight Reservation';
       Application.Run;
end.
2.        Recompile your application.
You are now ready to create and run tests on Delphi applications.
引用 删除 baomingyuan   /   2008-12-30 15:30:43
qtp安装完delphi的插件后在启动加载项打勾加载后是不是还需要什么配置才能录制delphi开发的脚本?
引用 删除 li_sy   /   2008-10-30 16:44:51
你好,想问一下,我用qtp录制delphi程序的时候,是可以正常识别对象的,但在回放时就找不到该对象了。不知道为什么?
报错信息如下:
Cannot identify the object "DelphiEdit" (of class DelphiEdit). Verify that this object's properties match an object currently displayed in your application.

Line (1): "DelphiWindow("DelphiWindow").DelphiEdit("DelphiEdit").Set "100.10.130.220"".

Tip: If the objects in your application have changed, the Maintenance Run Mode can
help you identify and update your steps and/or the objects in your repository.


1、报错的对象名字在对象库中存在。
2、对象库属性中只设置了“text”、“nativeclass”属性,没设置“window id”
 

评分:0

我来说两句

Open Toolbar