zoukankan      html  css  js  c++  java
  • 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文件

  • 相关阅读:
    c#基于事件模型的UDP通讯框架(适用于网络包编解码)
    菜鸟的mongoDB学习---(五)MongoDB的limit、skip、sort方法
    Session管理之ThreadLocal
    java中a++和++a在较复杂的运算中分析
    Spring2.5学习4.2_Proxy实现动态代理(目标类实现随意接口)
    申请美国签证超具体流程
    Class 与 new的配合使用
    关注PHPthinking官网微信公众号——红包来袭
    oracle-sql优化器
    POJ 2184 Cow Exhibition
  • 原文地址:https://www.cnblogs.com/gdg87813/p/10956297.html
Copyright © 2011-2022 走看看