Quality Center OTA API - 如何从用户字段中读取值列表

时间:2012-11-26 10:07:47

标签: list vbscript field lookup hp-quality-center

我正在使用Quality Center 10,并且有一个关于从用户字段中检索数据的问题:

我将测试用户字段定义为TS_USER_15,作为“查找列表”类型的“客户”字段,该字段具有多个值。 如何从作为测试运行的VB脚本中读取这些值列表? 感谢。

1 个答案:

答案 0 :(得分:1)

自己找到答案:

'Consider m_td_connection = TD_connection

Dim iGlobalListCounter, iListCounter, ValuesStr, ProductListName
ProductListName = "Status"
For iGlobalListCounter = 1 to m_td_connection.Customization.Lists.Count
    If m_td_connection.Customization.Lists.ListByCount(iGlobalListCounter).RootNode.Name = ProductListName Then
        ValuesStr = m_td_connection.Customization.Lists.ListByCount(iGlobalListCounter).RootNode.Children.Item(1).Name  ‘starting ValuesArr with the first value
        For iListCounter = 2 to m_td_connection.Customization.Lists.ListByCount(iGlobalListCounter).RootNode.ChildrenCount
            ValuesStr = ValuesStr & "," & m_td_connection.Customization.Lists.ListByCount(iGlobalListCounter).RootNode.Children.Item(iListCounter).Name
        Next
    End If
Next
Msgbox ProductListName & " list values = " & vbCrlf & ValuesStr