开发者

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 th开发者_JS百科e test case). Can somebody help out?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜