tags:

views:

1405

answers:

2

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?

+2  A: 

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.

Tom E
A: 

Launch QTP using the Automation (from any language that supports Automation), not only VBS

kj