【问题标题】:Running qtp tests automatically from a hudson instance从 hudson 实例自动运行 qtp 测试
【发布时间】:2010-10-15 12:56:32
【问题描述】:

我们有一台 Hudson 机器作为 Java Swing 项目的构建服务器。 构建过程基于 Ant 脚本(而不是 Maven)。

有没有人从 QuickTest Professional 集成测试是这样的配置?

换句话说:是否可以通过 Ant 自动执行 q​​tp 测试?

【问题讨论】:

    标签: ant hudson qtp


    【解决方案1】:

    不确定您的特定设置,但 QTP 有一个自动化 API,可用于驱动 QTP 本身。下面是一个示例 VBScript sn-p,您可以放入 .vbs 文件并从命令行调用。

    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
    Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
    
    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
    qtApp.Launch ' Start QuickTest
    qtApp.Visible = True ' Make the QuickTest application visible
    
    qtApp.Open "C:\Temp\simple_test", True ' Open the test in read-only mode
    
    ' set run settings for the test
    Set qtTest = qtApp.Test
    qtTest.Run ' Run the test
    
    WScript.StdOut.Write "Status is:" & qtTest.LastRunResults.Status ' Check the results of the test run
    qtTest.Close ' Close the test
    
    Set qtResultsOpt = Nothing ' Release the Run Results Options object
    Set qtTest = Nothing ' Release the Test object
    Set qtApp = Nothing ' Release the Application object
    

    以下链接 Integrating QTP... 描述了将 QTP 与 Ant 和 CruiseControl 集成的设置。

    【讨论】:

      【解决方案2】:

      是的,这是可能的。我可以为您提供将 QTP 与 Hudson 集成的步骤:

      1. 编写调用 QTP 的 VBScript (.vbs) 文件
      2. 此 vbs 文件应执行所有配置,例如添加加载项、对象存储库、库、加载环境变量等
      3. 在 Hudson 配置中,使用调用 shell 并将 vbs 文件作为命令行参数传递以调用 QTP 并运行测试
      4. 以 HTML 格式生成结果
      5. 使用 Hudson 的 HTML 报告插件
      6. 在 Hudson 仪表板中显示结果

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-04-27
        • 1970-01-01
        • 2011-05-30
        • 2012-05-19
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多