我正在使用 Interop.TDAPIOLELib.dll 进行 QC ALM 集成但是花了太多时间来获取所有测试计划树结构

I am using Interop.TDAPIOLELib.dll for QC ALM Integration But taking too much time for getting All Test Plan Tree Structure

我正在使用 Interop.TDAPIOLELib.dll 用于 QC ALM 12 集成并从工具 [=46] 安装 QcConnector.exe =] 来自我的 32 位 window 机器上的 QC ALM 12。

我想获取所有具有父文件夹层次结构的测试计划。但是它在 QC ALM(包括测试计划和文件夹)的 75 个工件周围花费了太多时间1 分 50 秒

  Private Sub LoadQCTree()

    Dim rootNode As Object = Nothing

    _treeManager = CType(_qcConnection.TreeManager, TreeManager)

    Dim rootList As TDAPIOLELib.List = _treeManager.RootList

    Dim rNode = rootList.Item(1)

    rootNode = _treeManager.TreeRoot(rNode)

    Dim FolderList As List = rootNode.NewList()

    'Read sub node hierarchy...

    RecurseTree(CType(FolderList, List))

    ReadChildTestCases(rootNode)

 End Sub


  Private Sub RecurseTree(ByVal SubNodes As TDAPIOLELib.List)

    For Each itm As SysTreeNode In SubNodes
        Dim Description = CStr(itm.Description).Trim
        If Not Description = "" Then Description = ConvertPlain(Description).Trim
        AddNodeEntry(itm.Name, CStr(itm.NodeID), CStr(itm.Father.NodeID), "Folder", Description, Now, Now, "TestCase", "folder")

        Dim children = itm.NewList
        RecurseTree(CType(children, List))
        ReadChildTestCases(itm)

    Next

  End Sub

  Private Sub ReadChildTestCases(ByVal itm As SysTreeNode)

    Dim testFilter As TDFilter = CType(_testFactory.Filter, TDFilter)

    testFilter.Filter("TS_SUBJECT") = Chr(34) & itm.Path & Chr(34)


    Dim TestList As List = _testFactory.NewList(testFilter.Text)

    For Each test As Test In TestList
        Try
            Dim description As String = Convert.ToString(test.Field("TS_DESCRIPTION")).Trim
            If Not description = "" Then description = ConvertPlain(description).Trim
            Dim modifiedOn As Date = CDate(test.Field("TS_VTS"))
            Dim CreationDate As Date = CDate(test.Field("TS_CREATION_DATE"))
            modifiedOn = Date.SpecifyKind(modifiedOn, DateTimeKind.Local)
            CreationDate = Date.SpecifyKind(CreationDate, DateTimeKind.Local)

            Dim BaseId = test.Field("TS_BASE_TEST_ID")
            Dim type = test.Field("TS_TYPE")
            AddNodeEntry(test.Name, CStr(test.ID), CStr(itm.NodeID), "File", description, modifiedOn, CreationDate, "TestCase", type)
        Catch ex As Exception
            'Do nothing..
            'Current node will skip from the tree hierarchy

        End Try
    Next
  End Sub

并且还想通过文件夹层次结构获取需求,但这也需要很多时间。

所以,我将尝试使用线程来提高性能。

线程 1:加载所有测试计划

线程 2:加载所有需求

和 运行 并行但我认为不支持并行请求。因为当我获取需求时它需要 40 秒(对于 30 个需求) 但是同时获取两个需求需要 1 分 15 秒 仅需求。

请帮我找出提高性能的方法。

一次调用即可获取所有测试计划树结构。

谢谢

如果您想要一个项目的所有要求和测试,那么将连接对象的工厂与 NewList("") 结合使用会更快。像这样(这只是伪代码):

RequirementFactory factory = connection.RequirementFactory;
List reqs = factory.NewList(""); /* this is all a project's requirements */

而不是遍历层次结构并获取每个文件夹的请求或测试。