Executing QC TestSet via OTA API (QCRunTestSet)
For the past few weeks, I have been actively working on Quality Center (ALM) and its integration with QuickTest Professional. One of the mini-projects I’ve worked on is creating a custom object that executes a test set and sends an email to the supplied distribution list from ALM TestSet’s Automation tab (as shown below):
Note: The above part (EMailTo) can be modified by either hard-coding it, or supplying an input from the Class Constructor.
I’ve extensively used the OTA API Reference to build this object and to understand how the API works. .NET developers having difficulty converting the VBScript code, please post in the comments section and I will mail you the class library (currently only C#).
Download (ALM Only)
QCRunTestSet is available for download, but comes as-is and currently executes TestSets on the localHost. However, I would be more than happy in helping you to modify this code to suit your needs.
If you’re having issues creating an instance of the
TSScheduler object, please read this thread. You may need to upgrade to a higher patch or perform a client registration on the execution machine.
Running QCRunTestSet from CommandLine
If you would like to pass parameters from the CommandLine instead of hard-coding them in the code, use WScript to pass arguments and WScript.Arguments to retrieve them in the class library. Example:
'Passing arguments wscript C:\QCRunTestSet.cls.vbs "http//<server>:8080/qcbin" myUser myPassword myDomain _ myProject myTestSetPath myTestSetName
'Retrieving arguments Set args = WScript.Arguments QCServer = args(0) UserName = args(1) Password = args(2) QCDomain = args(3) QCProject = args(4) QCTestSetPath = args(5) QCTestSetName = args(6)