1

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

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

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

4

2 回答 2

2

不确定您的特定设置,但 QTP 有一个自动化 API,可用于驱动 QTP 本身。下面是一个示例 VBScript 片段,您可以将其放入 .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 集成的设置。

于 2009-03-25T19:30:29.467 回答
1

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

  1. 编写调用 QTP 的 VBScript (.vbs) 文件
  2. 这个 vbs 文件应该进行所有配置,例如添加插件、对象存储库、库、加载环境变量等
  3. 在 Hudson 配置中,使用调用 shell 并将 vbs 文件作为命令行参数传递来调用 QTP 并运行测试
  4. 以 HTML 格式生成结果
  5. 使用 Hudson 的 HTML 报告插件
  6. 在 Hudson Dashboard 中显示结果
于 2011-10-14T05:33:16.990 回答