• 18.2.6 对QTP进行配置


    在完成前面的代码编写后,编译整个项目,然后可以通过配置项目中的"Configuration.XML"文件,在QTP录制和测试运行TrackBar控件的过程中使用这个Custom Server的逻辑。

    (1)双击打开如图18.7所示的Configuration.XML文件。

     
    图18.7  Configuration.XML文件

    XML文件内容大致如下:

    1. <!-- Merge this XML content into file "<QuickTest Professional>dat SwfConfig.xml". --> 
    2.   <Control Type="System.Windows.Forms.TrackBar" 
    3.     <CustomRecord
    4.       <Component
    5.         <Context>AUT</Context>        <DllName>D:QTPMyWorkQuickTestCustomServer1QuickTestCustomServer1Bin QuickTestCustomServer1.dll</DllName
    6.         <TypeName>QuickTestCustomServer1.TrackBarCustomerServer </TypeName
    7.       </Component
    8.     </CustomRecord
    9.     <CustomReplay
    10.       <Component
    11.         <Context>AUT</Context>        <DllName>D:QTPMyWorkQuickTestCustomServer1QuickTestCustomServer1Bin QuickTestCustomServer1.dll</DllName
    12.         <TypeName>QuickTestCustomServer1.TrackBarCustomerServer </TypeName
    13.       </Component
    14.     </CustomReplay
    15. <!--<Settings
    16.        <Parameter Name="sample name">sample value</Parameter
    17.     </Settings> --
    18.   </Control

    (2)把其中的"<Control>"到"</Control>"的这段内容复制,然后,打开< QTP安装目录 >dat 中的SwfConfig.xml文件,把刚才复制的内容替换SwfConfig.xml文件中的"<Controls>"到"</Controls>"段内的内容。粘贴后,SwfConfig.xml文件的内容如下所示:

    1. <?xml version="1.0" encoding="UTF-8"?> 
    2. <Controls
    3.   <Control Type="System.Windows.Forms.TrackBar" 
    4.     <CustomRecord
    5.       <Component
    6.         <Context>AUT</Context>        <DllName>D:QTPMyWorkQuickTestCustomServer1QuickTestCustomServer1Bin QuickTestCustomServer1.dll</DllName
    7.         <TypeName>QuickTestCustomServer1.TrackBarCustomerServer </TypeName
    8.       </Component
    9.     </CustomRecord
    10.     <CustomReplay
    11.       <Component
    12.         <Context>AUT</Context>        <DllName>D:QTPMyWorkQuickTestCustomServer1QuickTestCustomServer1Bin QuickTestCustomServer1.dll</DllName
    13.         <TypeName>QuickTestCustomServer1.TrackBarCustomerServer </TypeName
    14.       </Component
    15.     </CustomReplay
    16. <!--<Settings
    17.        <Parameter Name="sample name">sample value</Parameter
    18.     </Settings> --
    19.   </Control
    20. </Controls

    (3)首先确保首先确保元素中包含了正确的Custom Server编译的DLL的正确路径,然后保存SwfConfig.xml文件

  • 相关阅读:
    JavaScript实现继承的几种方式总结一
    MyISAM key 压缩
    Visual Studio2010英文版安装中文帮助文档
    回忆我是怎样走上程序之路的(上)起因
    hdu2054 A==B
    顺序表的增删排序
    hdu2145 zz's Mysterious Present
    hdu 2141 Can you find it?
    hdu1162 Eddy's picture
    hdu1142 A Walk Through the Forest
  • 原文地址:https://www.cnblogs.com/gdg87813/p/10956297.html
Copyright © 2020-2023  润新知