首页 > 解决方案 > 我能够从 ALM 获取文件夹,但不能从测试中获取 - c#

问题描述

我正在尝试阅读 ALM 中特定文件夹中的测试列表。它获取子文件夹但无法读取测试用例。没有失败,只是没有进入第二个foreach循环

static void Main(string[] args)
    {
        TDConnection con = createConnection("", "", "", "");
        TreeManager TreeMgr = con.TreeManager;
        var SubjRoot = TreeMgr.get_NodeByPath(@"Subject\Regression");
        TestFactory TestFact = SubjRoot.TestFactory;
        var SubjectNodeList = SubjRoot.FindChildren("", false, "");

        foreach (var node in SubjectNodeList)
        {
            System.Console.WriteLine(node.path);


            var TestFilter = TestFact.Filter;
            TestFilter.Filter["TS_SUBJECT"] = @"""" + node.path + @"""";
            var TestList = TestFact.NewList(TestFilter.Text);
            foreach (var oTest in TestList)
            {
                Console.WriteLine("Test Name=" + oTest.Name + "' Test Type=" + oTest.Type);
            }
        }
        Console.ReadKey();
    }

标签: c#integrationalm

解决方案


推荐阅读