Running qtp tests automatically from a hudson instance

纵然是瞬间 提交于 2020-01-03 01:47:07

问题


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?


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/682938/running-qtp-tests-automatically-from-a-hudson-instance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!