In this video I show a simple example on how to use Quality Center’s Open Test Architecture (OTA) in QuickTest Pro.
Code used in video to get a QC test resource:
saveTo = "D:\DEMO" resourceName = "QCGETRESOURCE.txt" Set qcConn = QCUtil.QCConnection Set oResource = qcConn.QCResourceFactory Set oFilter = oResource.Filter oFilter.Filter("RSC_FILE_NAME") = resourceName Set oResourceList = oFilter.NewList If oResourceList.Count = 1 Then Set oFile = oResourceList.Item(1) oFile.FileName = resourceName oFile.DownloadResource saveTo, True End If
* About the code:
The QCUtil object is used to access the Quality Center Open Test Architecture (OTA) interface. You can use the properties associated with the QCUtil object to return Quality Center OTA objects. Using the property QCConnection object, allow you to interact with the current Quality Center session and provides access to the Quality Center object model.
The QCResourceFactory object allows you to manage the QC resources section. You can use the Filter property to locate the resource that you want. Then the Filter’s NewList method is used to create a list of objects according to the specified filter.
To save and retrieve files from a QC test set ‘attachment' tab check out:QC & QTP – How to Attach a File to a Test Sets Attachment Tab