Home » QTP, Quality Center

Run QTP framework in quality center

29 June 2009 2,258 views One Comment Author: Puneet Kalra

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”

Public Sub SaveAttachmentToTestObj(TestObj, LocalFilePath, FileDescription)
Set Attachments = TestObj.Attachments
Set Attachment = Attachments.AddItem(Null)
Attachment.FileName = LocalFilePath
Attachment.Description = FileDescription
Attachment.Type = 1′TDATT_FILE
Attachment.Post ‘ Commit changes
End Sub

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.

Popularity: 55% [?]

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.33 out of 5)
Loading ... Loading ...

One Comment »

  • admin said:

    test comment

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.