Run QTP framework in quality center


If you have made an excel driven framework in QTP which runs on the local machine and now want to run it from quality center as well without making major changes in the script, then this post is for you.

In this scenario, you can download QTP files from quality center using QC-OTA.
Create folders/subfolders on the drives using vbs and download the appropriate files that are attached to a testset / testsetfolder etc.
Keywords for OTA:-
  • AttachmentFactory
  • Attachment
  • ExtendedStorage
  • TestSetFolder
  • TestSetFactory
  • TestSet
There is one more way to do the same. You need to save the QTP script in Quality Centre and run it from there under the test set.
To save the attachment as the attachment of the test run, here is the code:
File in file system to attach:
SaveAttachment “C:\BusServiceMVI_IT_OT_QTP8_081506.xls”, “Test Description”
Run QTP framework in quality center
This function saves an attachment to the current test (the test must be existing on TestDirector).
LocalFilePath: Path indicating the location of the attachment on the local filesystem
FileDescription: Description of the file (Description field on TestDirector)
Public Function SaveAttachment(LocalFilePath, FileDescription)
SaveAttachmentToTestObj QCUtil.CurrentTest, LocalFilePath, FileDescription
End Function
Just remember, all you need is QTP and access to a project created in quality Center. This is all that is required. Rest can be done by the code.

1 comment:

  1. Excellent article on how to connect QC and QTP. I always encourage my team to run QTP through QC because it helps with metrics reporting.