0

在 HP Qualtiy Center 中,我有一个测试用例,其中附有一些文件。我想直接从其他测试用例(不是测试用例)调用附件。有人可以帮忙吗?

4

1 回答 1

1

您可以定义一个自定义操作(将显示为附加按钮),并使用 OTA API 在用户单击该图标时检索您想要的附件。

(自从我使用 QC 工作流程以来已经有一段时间了,因此对可能的语法错误表示歉意,但它证明了这个想法)

通过 UI 添加新的操作按钮(我们称之为“getMyFiles”)。在那个 catch 事件之后 - 用户点击了按钮:


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

现在检索附件并对它们做任何你想做的事情(例如打开...复制...保存在某处)


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

就是这样

于 2011-03-08T05:32:09.940 回答