【问题标题】:Not able to update the tester name in a Test Set from vbscript无法从 vbscript 更新测试集中的测试人员名称
【发布时间】:2020-12-30 11:57:55
【问题描述】:

我一直在尝试在线搜索解决方案,但由于缺乏 HP ALM 知识,我无法搜索正确的命中标签

  Set RunFactory = tsTest.RunFactory
  Set obj_theRun = RunFactory.AddItem(CStr(testrunname))
  obj_theRun.Status = sExecutionStatus '"Passed" '-- Status to be updated
  obj_theRun.Tester = strTesterName  

在此行对象中出现错误不支持 obj_theRun.Tester

我只想通过 vbscript 更新测试集中的测试人员列(不负责任的测试人员)。请参考最后一栏的附图(TesterAny 帮助表示感谢。提前谢谢您。

【问题讨论】:

标签: vbscript alm


【解决方案1】:

ALM 的文档说可以通过将数组作为参数传递给 AddItem 来指定测试人员名称。

https://admhelp.microfocus.com/alm/api_refs/ota/Content/ota/topic8805.html?Highlight=tester

由以下元素组成的数组:

  1. 名称 - 运行的名称(字符串。必需)。
  2. 测试人员 - 负责用户的姓名(字符串。可选)
  3. 位置 - 主机名(字符串。可选)。默认是当前机器的主机名

所以把你的代码改成这样:

Set runFactory = tsTest.RunFactory

Dim newRunArgs(3)
newRunArgs(0) = testrunname ' `testrunname` is already a string so you don't need CStr.
newRunArgs(1) = "tester name goes here"
Set newRunArgs(2) = Nothing

Set newRun = RunFactory.AddItem( newRunArgs )
newRun.Status = sExecutionStatus '"Passed" '-- Status to be updated

【讨论】:

  • newRunArgs(2) 中抛出错误。 (类型不匹配)
  • @nishitdey 我已经更新了我的答案。请重试。
  • 对象变量未在newRunArgs(2) = Nothing行中设置
  • 最后一个问题我如何清除newRunArgs(3)。因为在第二次运行中它失败了。
  • @nishitdey 我建议您阅读 VBScript 的文档,以便真正了解发生了什么,而不是为遇到的每个小问题提出新问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-07
  • 2012-11-10
  • 1970-01-01
相关资源
最近更新 更多