【发布时间】:2016-05-12 19:50:32
【问题描述】:
有没有办法使用 OTA 来操纵 ALM 中的测试计划?
例如,我在 ALM 中有 350 个测试计划,我想更改每个测试计划的参数设置。手动做很傻。
更新 1:
在对 OTA 进行了数小时的研究之后,我得到了以下信息:
通过使用下面的代码,我可以转到一个测试计划并获取它的名称,但仍然不知道如何获取其中的 BPComponents 的完整列表...
set tdc = createobject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "http://URL:8080/qcbin"
tdc.Login "Username","Password"
tdc.Connect "Domain","Project"
If tdc.Connected = true Then
print "Connect successful!!!"
End If
Set TreeMgr = tdc.TreeManager
Set SubjRoot = TreeMgr.NodeByPath("Subject\")
Set TestFact = tdc.TestFactory
Set SubjectNodeList = SubjRoot.FindChildren("", False, "")
For Each oSubjectNode In SubjectNodeList
'Print out the subject path
'Print oSubjectNode.Path
'Does this have any tests?
Set TestFilter = TestFact.Filter
TestFilter.Filter("TS_SUBJECT") = Chr(34) & oSubjectNode.Path & Chr(34)
Set TestList = TestFact.NewList(TestFilter.Text)
For Each oTest In TestList
print oTest.Name
'=============get stuck here========================
Set Components=oTest.BPComponent
Set Component=Components.Item(1)
'=============trying to get components list==========
Next
Next
This post 似乎提供了一种编辑参数值的方法。但问题是Test 对象不支持Test.Load 方法。
更新 2:
经过更多研究,我认为我们不能通过 UFT/QTP 来做到这一点。原因是:根据OTA官方指南(链接here),我们需要“将Test转换为BusinessProcess”。似乎这不能在 VBScript 中完成,因为 VBS 没有 Dim As 或 CType 之类的东西。
下一步:也许我可以尝试在测试计划级别而不是组件级别?
【问题讨论】:
标签: qtp hp-uft alm hp-quality-center