Example #1
0
        //Add the special folder under the ROOT\AUTORUN
        //If the folder has already exist, then return the folder handle
        private TestSetFolder CreateTestSetFolder(string FolderName)
        {
            string rootPath = "Root\\AUTORUN\\";

            try
            {
                TestSetTreeManager TestSetTreeMana   = tdConn.TestSetTreeManager as TestSetTreeManager;
                TestSetFolder      TestSetFolderPath = TestSetTreeMana.get_NodeByPath(rootPath) as TestSetFolder;
                //Add a new folder under the rootPath

                if (CheckFolderIsExist(TestSetFolderPath, FolderName))
                {
                    AutoLog.Info("AutoIntSys: Test folder has already in QC!");
                    //Debug.Print("AutoIntSys: Test folder has already in QC!");
                    SysTreeNode   getTestSetFolder = TestSetFolderPath.FindChildNode(FolderName) as SysTreeNode;
                    TestSetFolder TSExistFolder    = TestSetTreeMana.get_NodeById(getTestSetFolder.NodeID) as TestSetFolder;

                    createTFSucess = false;
                    return(TSExistFolder);
                }

                SysTreeNode CurTestSetFolder = TestSetFolderPath.AddNode(FolderName) as SysTreeNode;
                CurTestSetFolder.Post();

                //The new test set will be added under the newly test folder
                TestSetFolder TSFolder = TestSetTreeMana.get_NodeById(CurTestSetFolder.NodeID) as TestSetFolder;
                createTFSucess = true;
                return(TSFolder);
            }
            catch (Exception e)
            {
                AutoLog.Info("AutoIntSys: Exception with " + e.Message);
                AutoLog.Info("AutoIntSys: Create Test Sets Error!");
                //Debug.Print("AutoIntSys:Create Test Sets Error!");
                //Debug.Print("AutoIntSys:" + e.Message);
                return(null);
            }
        }