Pradeep
Pradeep

Reputation: 3468

Quality Center: link to attachment

In HP Qualtiy Center, I have a test case where I have attached some documents. I want to call directly the attachment from other test cases(not the test case). Can somebody help out?

Upvotes: 0

Views: 1674

Answers (1)

ksbytes
ksbytes

Reputation:

You can define a custom action (which will appear as additional button), and use OTA API to retrieve attachments you want when user clicks on that icon.

(it's been a while since I worked with QC workflow, so apologies for possibly wrong syntax, but it demonstrates the idea)

Add new action button through UI (let's call it "getMyFiles"). After that catch event - user clicked the button:


Function ActionCanExecute(Action) 
...
if Action = "getMyFiles"
    getMyFiles
end if
...
End Function

Now retrieve the attachments and do whatever you want with them (e.g. open...copy...save somewhere)


Sub getMyFiles
    Set tst = TDConnection.TestFactory.Item(##id of the test with attachments##)
    Set attf = tst.Attachments
    ' From here you can do whatever you want with those attachments
    ' In my example I will just download them:
    Set attLst = attf.NewList("")
    For Each att In attLst
        ' Don't remember what those parameters mean (took from old example), 
        ' so check OTA API guide
        att.Load True, "" 
    Next
End Sub

That's about it

Upvotes: 1

Related Questions