我们在工作中有一台 Hudson 机器,它充当 Java Swing 项目的构建服务器。构建过程基于 Ant 脚本(而不是 Maven)。
有没有人从 QuickTest Professional 集成测试是这样的配置?
换句话说:是否可以通过 Ant 自动执行 qtp 测试?
不确定您的特定设置,但 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 集成的设置。
是的,这是可能的。我可以为您提供将 QTP 与 Hudson 集成的步骤: