从 hudson 实例自动运行 qtp 测试

发布于 2024-07-15 16:14:11 字数 170 浏览 7 评论 0原文

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

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

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

We have at work a Hudson machine that acts as a build server for a Java Swing Project.
The build process is based on Ant scripts (and not Maven).

Has anyone integrated tests from QuickTest Professional is such configuration?

In other words: Is it possible to execute qtp tests automatically via Ant?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

隐诗 2024-07-22 16:14:11

不确定您的具体设置,但 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

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

Not sure about your particular setup, but QTP has an automation API which can be used to drive QTP itself. Below is an example VBScript snippet you could drop into a .vbs file and call from the command line.

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

The following link, Integrating QTP..., describes a setup for integrating QTP with Ant and CruiseControl.

画▽骨i 2024-07-22 16:14:11

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

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

Yes, this is possible. I can provide you steps to integrate QTP with Hudson:

  1. Write a VBScript (.vbs) file which invokes QTP
  2. This vbs file should do all configurations such as adding add-ins, object repositories, libraries, loading environment variables, etc
  3. In Hudson configuration, use invoke shell and pass the vbs file as command line argument to invoke QTP and run tests
  4. Generate the results in HTML format
  5. Use HTML reports plugin of Hudson
  6. Display the results in Hudson Dashboard
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文