// get test set explorer(tree view) public static List <QCTestSetSummary> GetTestSetExplorer(string PathNode) { List <QCTestSetSummary> testlabPathList = new List <QCTestSetSummary>(); string[] separatePath = PathNode.Split('\\'); separatePath[0] = ExploredTestLabFolder.ContainsKey("Root") ? ExploredTestLabFolder["Root"] : QcRestClient.GetTestSetRootFolder().Id; if (!ExploredTestLabFolder.ContainsKey("Root")) { ExploredTestLabFolder.Add("Root", separatePath[0]); } for (int i = 1; i < separatePath.Length; i++) { separatePath[i] = GetTestLabFolderId(separatePath[i], separatePath[i - 1]); } QCTestSetColl testSets = QcRestClient.GetAllTestSetsUnderFolder(int.Parse(separatePath[separatePath.Length - 1])); foreach (QCRestClient.QCTestSet testset in testSets) { QCTestSetSummary QCTestSetTreeItem = new QCTestSetSummary(); QCTestSetTreeItem.TestSetID = testset.Id; QCTestSetTreeItem.TestSetName = testset.Name; testlabPathList.Add(QCTestSetTreeItem); } return(testlabPathList); }
// get test set explorer(tree view) public static List <ALMTestSetSummary> GetTestSetExplorer(string PathNode) { List <ALMTestSetSummary> testlabPathList = new List <ALMTestSetSummary>(); string[] separatePath = PathNode.Split('\\'); try { separatePath[0] = ExploredTestLabFolder.ContainsKey("Root") ? ExploredTestLabFolder["Root"] : QcRestClient.GetTestSetRootFolder().Id; if (!ExploredTestLabFolder.ContainsKey("Root")) { ExploredTestLabFolder.Add("Root", separatePath[0]); } for (int i = 1; i < separatePath.Length; i++) { separatePath[i] = GetTestLabFolderId(separatePath[i], separatePath[i - 1]); } QCTestSetColl testSets = QcRestClient.GetAllTestSetsUnderFolder(int.Parse(separatePath[separatePath.Length - 1])); foreach (QCRestClient.QCTestSet testset in testSets) { ALMTestSetSummary QCTestSetTreeItem = new ALMTestSetSummary(); QCTestSetTreeItem.TestSetID = testset.Id; QCTestSetTreeItem.TestSetName = testset.Name; testlabPathList.Add(QCTestSetTreeItem); } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Failed to get Test Set with REST API", ex); } return(testlabPathList); }