QTP的Delphi插件扩展开发
Delphi自动化测试
http://www.cnblogs.com/testware/archive/2010/10/11/1847746.html
1、安装Delphi插件
2、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.
注:QTP10需要装QTP_00591.EXE补丁,不装的话能识别出Delphi控件,但是录制不下脚本,OR中属性也缺少Delphi_name.(测试环境Windows Server2003、Delphi6)
QTP11则没问题
3、插件扩展开发
部署方法:
To deploy the toolkit support set that you create, you must place the XML files in specific locations within the QuickTest installation folder. The following table describes the appropriate location for each of the toolkit support files:
a.Test Object Configuration file
<QuickTest installation folder>\dat\Extensibility\Delphi
<QuickTest Add-in for Quality Center installation folder>\dat\Extensibility\Delphi
(Optional. Required only if QuickTest Add-in for Quality Center is installed)
b.Toolkit Configuration file
<QuickTest installation folder>\dat\Settings
Icon files for custom test object classes (optional) The file can be a .dll or .ico file, located on the computer on which QuickTest is installed, or in an accessible network location.
Specify the location in the test object configuration file.
Help files for the test object classes (optional) Must be a .chm file, located on the computer on which QuickTest is installed.
Specify the location in the test object configuration file.
Compiling Your Extensibility Code
If you developed an extensibility Delphi unit, you must compile the application you are testing with the QuickTest Professional Delphi Add-in precompiled agent and with your extensibility unit. To do this, perform the following steps:
Add the <QuickTest Professional Installation folder>\dat\Extensibility\Delphi folder to the search path of the application's project or copy the contents of the <QuickTest Professional Installation folder>\dat\Extensibility\Delphi folder to the project folder.
Add MicDelphiAgent to the Uses section of your application's project file.
If your application includes the TwwDBGrid from InfoPower, add MicWWSupport to the Uses section of your application's project file after MicDelphiAgent.
Add the location of your extensibility code to the search path of the application's project or place your file in the project folder.
Add the name of your extensibility unit to the Uses section of your application's project file.
Compile the Delphi application project.
Delphi2006 Tabs 控件的插件扩展开发实例下载:
https://files.cnblogs.com/testware/QTP_Delphi2006_Ext.rar
TIB自动化测试工作室提供各类Delphi插件扩展开发的培训和服务,欢迎联系咨询!